wpf

Performance impact of Wpf Binding Path={x:Static <propertypath>} ?

I have a CLR instance property, a static PropertyPath which points to the instance property and a xaml binding which uses the static PropertyPath directly like so: NB: GetPropertyPath is simply a method which returns the propertypath based on the given linq expression from the member name. public static PropertyPath MyPropertyPat...

How to get the ListBoxItem for an item in ListBox on "bind-time"

I have a ListBox with Foo objects, and based on some events I disable/enable the ListBoxItems in the ListBox. Using the ListBox.Items property I find Foo objects, and from what I've understood I need to use the following function to get the ListBoxItem container for the Foo. Correct? foreach (var item in Items) { var lbi = ItemCont...

What is the difference between Property and Dependency Property

Dependency properties are created the same way as properties. Is a dependency property used only while creating a custom control? ...

How can I implement this one line XAML programmatically in WPF code?

Hi, How can I implement this one line XAML programmatically in code? (as I'm needing to create the radio buttons on the fly, but what them to having bindings) <RadioButton IsChecked="{Binding Path=Mode, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Proxy}">Proxy</RadioButton> I've got it to here (see below) so ...

Smart client Winform vs MVVM + Prism

Hi, I am new to desktop applications, so please bare with me if this sounds very basic question. The question is, is Windows forms Simart Client is a legacy thing now? and to be replaced by Prism (and/or MVVM)? Should I bother to learn about Smart Client? Another question which might be related to is that what are the performance diffe...

how to add emoticons(smileys) into WPF richtext box

I have a WPF IM chat window with a input textbox and a output richtext box. I want to render input text on the richtext box. When user enter a smiley symbol like :) into the text block with some texts, I want to replace that text smiley with predefined smiley image and render on the richtext box. It's very similar to gtalk chat window be...

WPF optical style of dynamically created MenuItem-Separator in MVVM

I have have a MenuItem that creates its sub-menu-items dynamicly from the ItemsSource-property. For grouping, I have Separators in the menu. The separator is created for each null-entry in the ItemsSource-collection by a ControlTemplate of the MenuItem.ItemContainerStyle. This works fine, however has the separator not the same optica...

Binding ObservableCollection<Foo> to ObservableCollection<object>

I have a collection ObservableCollection<Foo>, and I want to bind this to a property in a custom controller of type ObservableCollection<object>. However, the bound value never reaches the PropertyCallback, and is hence never set. Is there a clever way to achieve this binding? I could create an IValueConverter that converts from Observ...

Strange scaling problem in WPF

I've got a Canvas and I put some stuff on it, then I scaled it. But, when you run the scales, they don't originate from the point they should, like, if you scale it from one origin a bit, then scale from another origin, the second origin acts as if it's been offset somewhat in a really strange fashion instead of behaving as intended (and...

Howto observe converted collections?

I bind a collection ObservableCollection<Foo> to a dependency property on my controller, but I run it through an IValueConverter to make it ObservableCollection<object> instead, which is what my controller expect. The conversion works fine - I create an ObservableCollection<object> and fill it with all the Foo's from the original list. T...

Validation ErrorTemplate not showing on data errors

This is a bit of a WPF whodunnit! Update1: Getting there! It seems that error templates are shown in the adorner layer. When I call var myAdornerLayer = AdornerLayer.GetAdornerLayer(this.txtCaseNumber); myAdornerLayer is null. (After the control is loaded so it's not that). So it seems to be something do with adorners, rather than...

WPF GroupBox ControlTemplate : How to apply a Style only to elements in the Header ?

Hi. I'm trying to make a ControlTemplate for a GroupBox such as if a TextBlock is declared in the Header it's background should be set to yellow. The problem is that, although I define a style for TextBlocks in the ContentPresenter for the Header, it's not applied except on those TextBlocks which are autogenerated by WPF. Here is the...

If WPF died, would anybody notice?

I just came across Tim Anderson's latest blog entry about MS' future regarding HTML5, Silverlight, WPF, and wonder, where is this all going. My personal experience is that I have never seen a WPF application, got a project enquiry re WPF only once, and have no idea where SL is actually used. To avoid the risk of having this question cl...

How to change the XAMLstring into XMAL code to paste in the RichTextBox in WPF?

Hi all, am using richtextbox in my window and here am getting an input as a string ,this string will be xmal string and here i need to paste the string with a same format what i entered ...i got a code form stackoverflow but it works for only one if the XAMLstring has more than one paragraph means it is not working ,here the example XM...

Does Visual Studio Express C# 2008 come with the WPF libraries?

I need to know if Windows systems that have VS Express c# 2008 will have had the WPF libraries installed along with the VS installation (XP, so it's not preinstalled on the system). Google didn't really turn up much. ...

Need a simple Example of cascading combo boxes using MVVM

Need a simple Example of cascading combo boxes using MVVM Wpf / Silverlight ...

How can I programmatically set a tooltip on disabled buttons?

I´d like to know how can I programmatically set a tooltip on disabled buttons. ...

Displaying and editing XML data with a WPF TreeView

Hi, I'd like to visualize XML data with the WPF TreeView control. The treeview displays all elements of the XML data in hierarchical order. Below the treeview is a ListBox containing TextBoxes for editing the name, the value of the element and all its attributes. I have figured out how to display the XML data in the treeview. But I don...

Run Animation when Dependency Property Changes

I have created a UserControl with two dependency properties: Value and Color. The Color of the UserControl is dependent on the Value property. For example if Value=0 Color=Blue, Value=0.5 Color=Red and so on. This I have achieved using a custom converter that is bound to the Fill property, like so: <Ellipse Name="dotForeground" Stroke="...

WPF animated splash screen

Is it possible to show a splash screen in WPF that has animation. I want my name of the company and the name of the application to fly in and a progress bar that continously animates. I Used this example http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen to try and get me started but the progress bar do...