wpf

WPF Window Real-Time Preview

I have a window in WPF which shows some media contents. This content contains WPF animations, videos, images etc. My need is to create a real-time preview for this window. Can I create this using WPF? Look at below image, my requirement is to show preview of Window2 in preview area in Window1. ...

How do I completely replace the content of a WPF button with a graphic path?

I've deconstructed a standard WPF button using Blend and have managed to create a nicely styled button, but I cannot figure out how to make the path fill the interior of the button space (the button width and height). I am also not sure if I need to specify ContentPresenter or even if it is correct. I am after the text in the middle of t...

MaxAutoWidth in WPF

Is there a good way to limit the Auto Width of an element or Grid Column? I want to limit the Auto Width only, but allow any user changes. For example, I want to allow GridSplitter to arbitrarily resize the column, but the initial (Auto) Width should not exceed a specific value. Same for the elements -- I want to allow resizing, but lim...

Setting DependencyProperty on child of WPF composite control

This is working in WPF documents, but I am thinking this is not restricted to that scope and applies at least to all WPF custom controls. I have a custom, composite, inline control in a WPF document. My control inherits from Span and has a custom Run control as a child. Public Class MyTextInput Inherits Span Private mInnerRun As Bind...

Assembly-wide / root-level styles in WPF class library

I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on http://dotupdate.wordpress.com/2007/12/05/how-to-add-a-wpf-control-library-template-to-visual-c-express-2008/). I've created several windows, and am now attempting to create a common style set for them. However, as it's a class library (instead of a WPF app), ...

How to draw 3D mathematical models in .NET? What 3D engine would best suitable to do this effectively?

Hi, I recently faced a problem of presenting the output of simple genetic algorithm that looks for extremes of 2 argument function f(x1,x2) . I would like to be able to use x1 as x, x2 as y and f as z and to draw points in 3d space that I could rotate. ( I'm currently drawing this on bitmap using color as the 'z axis'.) Where should I ...

WPF - setting HorizontalAlignment= Stretch to Texbox in StackPanel

Hi, Why doesn't a texbox stretch to fill space in a stackpanel?? Is this by design?? In a grid its fine. Malcolm ...

How can you change the highlighted text color for a WPF TextBox?

The WPF TextBox natively makes use of the System Highlight color for painting the background of selected text. I would like to override this and make it consistent since it varies by OS/user theme. For ListBoxItems, there is a neat trick (see below) where you can override the resource key for the HighlightBrushKey to customize the Syst...

Problem with WPF Data Binding Defined in Code Not Updating UI Elements

I need to define new UI Elements as well as data binding in code because they will be implemented after run-time. Here is a simplified version of what I am trying to do. Data Model: public class AddressBook : INotifyPropertyChanged { private int _houseNumber; public int HouseNumber { get { return _houseNumber; } ...

WPF design rendering is dramaticaly slow Visual Studio 2008? Are there any tweaks that could speed it up?

I just wanted to do some tutorials in WPF but I find that the designer works very slow in comparision to Windows Forms/GDI+. Are there any tweaks to speed it up? ...

Setting dropdown height of a combobox in WPF

I have a combobox in WPF that I add items to at run-time (via a data binding to a List). I'd like to set the height of the dropdown box dynamically so that all (or most) of the items show. Unfortunately it seems that the height of the dropdown is set once and cannot be dynamically altered. It always seems to be the same size. Is ther...

Custom properties in XAML of System.Windows.Window

Hello! I've got a very simple WPF UserControl that looks like this: namespace WpfControlLibrary1 { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); Composite = new Composite(); Composite.Color = Colors.Red; } protected override void OnRender(DrawingC...

Initial validation on dynamically added control

WPF validation system performs intial validatation of an object (I mean - all fields are validated when a databound item is changed, and results are displayed on the ui). But it doesn't work like this, when I add a control dynamically. In such case inital validation happens, but results aren't shown on the ui. Only after some properties ...

How to make two images overlapping with WPF?

I have the following XAML code, which displays a picture (image inside borders) and a logo. Right now, the logo appears below the picture. This is expected, however my goal is to have the logo on top of the picture (precisely at the bottom-right corner). Does someone has an idea how to do that? Do we have layers in WPF? Note: I absolute...

WPF Datatemplating an ItemsControl

I have an ItemsControl whose ItemsSource gets bound to an ObservableCollection<Component> at run time. I have defined a data template for type Component which works fine. Now Component has a ObservableCollection<Control> and I want to add another ItemsControl inside my Component Datatemplate to render all the controls. Control here is ...

WPF Databinding not calling !!

I am using UserControl which has TextBox, Button control. The Button opens a FileDialog and user selects the file. The selected file is transferred into the FileName property which is a dependency property. For some reason the TextBox is not binding to this property. Here is the code: <UserControl x:Class="WPF3D.FileInputBox" xmlns...

What's the best book on designing pretty GUI for .NET applications?

Hi, What's the best book on designing pretty GUI for .NET applications? like Windows Vista style? Thank you. ...

What does the user need to run a WPF browser application?

I've been developing on WinForms and WebForms since the last 4 years. I didn't consider migration to WPF till now, but I am considering it now. Please tell me what's required at the client end to properly run WPF applications in the browser. What are the platforms it's compatible with? Does the user need to install any special plugin? ...

Binding for WPF Styles

I'm trying to create a custom control - a button - which will have multiple styles applied to it depending on the value of a property within the data context. What I was thinking is using something similar to: <Button Style="{Binding Path=ButtonStyleProperty, Converter={StaticResource styleConverter}}" Text="{Binding Path=TextProp}" />...

Anyone else agree that VS2008 WPF designer needs whole lot of work done on it.

Hi, I have xaml pages that the designer say there is an error and yet the app compiles and runs. WPF team does not have time for holidays that they heaps todo. Maybe they should think about getting this one working first before the next version. Malcolm EDIT: This is really born from frustration with bugs MS software tools. And I me...