wpf

Hiding inherited members in C#

I'm looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes. Some of the more recent descendant classes inherit dependency properties which have become vestigial and can be a little confusing when using intellisense or using the classes in a visual designer. These ...

Numeric Data Entry in WPF

How are you handling the entry of numeric values in WPF applications? Without a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly. Has anyone found a more graceful way to get numeric data from the user without relying on a third-party control?private void Nume...

WPF Databinding

Can anyone point me to a good resource (or throw me a clue) to show me how to do databinding to controls (combobox, listbox, etc.) in WPF? I'm at a bit of a loss when all my WinForms niceities are taken away from me, and I'm not all that bright to start with... Many Thanks, my fellow Stackies. ...

What is the value-binding syntax in xaml?

I'm getting all learned up about binding in WPF. I'm having a lot of trouble debugging the parse errors in my xaml, though. Can somebody pretty please tell me what's wrong with this little piece? : <Border Name="TrackBackground" Margin="0" CornerRadius="2" ...

What real world WPF applications are out there?

Im currently working with WPF and Ive seen a couple of examples on dnrtv and some other places. I'd like to see more real stuff. Anybody knows of good examples? Thanks The list so far: http://en.wikipedia.org/wiki/Windows_Presentation_Foundation#WPF_Applications http://www.hanselman.com/babysmash/ Tim Sneath list Lawson client Yaho...

Instrumenting a UI

How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI. By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrumentation is http://msdn.microsoft.com/en-...

I don't grok the WPF command pattern

I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands? ...

What WPF books would you recommend?

Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend? ...

WPF: How to style or disable the default ContextMenu of a TextBox

Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background. I know this works well: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.co...

WPF - Sorting a composite collection

So WPF doesn't support standard sorting or filtering behavior for views of CompositeCollections, so what would be a best practice for solving tihs problem. There are two or more object collections of different types. You want to combine them into a single sortable and filterable collection (withing having to manually implement sort or ...

How to host a WPF form in a MFC application

I'm looking for any resources on hosting a WPF form within an existing MFC application. Can anyone point me in the right direction on how to do this? Thanks, --Mark ...

Variable Bindings in WPF

I’m creating a UserControl for a rich TreeView (one that has context menus for renaming nodes, adding child nodes, etc.). I want to be able to use this control to manage or navigate any hierarchical data structures I will create. I currently have it working for any data structure that implements the following interface (the interface nee...

Preventing Memory Leaks with Attached Behaviours

Hi guys, I've created an "attached behaviour" in my WPF application which lets me handle the Enter keypress and move to the next control. I call it EnterKeyTraversal.IsEnabled, and you can see the code on my blog here. My main concern now is that I may have a memory leak, since I'm handling the PreviewKeyDown event on UIElements and ne...

How to get list of installed BitmapEncoders/Decoders (the WPF world)?

In WindowsForms world you can get a list of available image encoders/decoders with System.Drawing.ImageCodecInfo.GetImageDecoders() / GetImageEncoders() My question is, is there a way to do something analogous for the WPF world that would allow me to get a list of available System.Windows.Media.Imaging.BitmapDecoder / BitmapEncoder ...

How to apply multiple styles in WPF

In WPF, how would I apply multiple styles to a FrameworkElement? For instance, I have a control which already has a style. I also have a separate style which I would like to add to it without blowing away the first one. The styles have different TargetTypes, so I can't just extend one with the other. ...

Enabling a button in WPF depending on ListBox.SelectedIndex

I have a rather classic UI situation - two ListBoxes named SelectedItems and AvailableItems - the idea being that the items you have already selected live in SelectedItems, while the items that are available for adding to SelectedItems (i.e. every item that isn't already in there) live in AvailableItems. Also, I have the < and > buttons...

What is the correct way to create a single instance application?

Using C# and WPF under .net (rather than WindowsForms or console), what is the correct way to create an application that can only be run as a single instance? I know it has something to do with some mythical thing called a mutex, rarely can I find someone that bothers to stop and explain what one of these are. The code needs to also inf...

Rich GUI OS X Frameworks?

What would you recommend for OS X development of a graphical application like those possible in WPF? My specific background is in Smalltalk & Java, but I currently work mostly in DHTML/.NET (ASP.NET/C#). ...

How to stop an animation in C# / WPF?

I have something like this: barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation( barProgress.Value, dNextProgressValue, new Duration(TimeSpan.FromSeconds(dDuration))); Now, how would you stop that animation (the DoubleAnimation)? The reason I want to do this, is because I would like to start new animations...

WPF Image UriSource and Data Binding

I'm trying to bind a list of custom objects to a WPF Image like this: <Image> <Image.Source> <BitmapImage UriSource="{Binding Path=ImagePath}" /> </Image.Source> </Image> But it doesn't work. This is the error I'm getting: "Property 'UriSource' or property 'StreamSource' must be set." What am I missing? ...