wpf

WPF ListBox WrapPanel clips long groups

I've created a ListBox to display items in groups, where the groups are wrapped right to left when they can no longer fit within the height of the ListBox's panel. So, the groups would appear similar to this in the listbox, where each group's height is arbitrary (group 1, for instance, is twice as tall as group 2): [ 1 ][ 3 ][ 5 ] [ ]...

How do I use an icon that is a resource in WPF?

I have a .ico file that is embedded as a resource (build action set to resource). I am trying to create a NotifyIcon. How can I reference my icon? notifyIcon = new NotifyIcon(); notifyIcon.Icon = ?? // my icon file is called MyIcon.ico and is embedded ...

Scalable Moebius strip in WPF

A moebius strip is a surface with one side. How would one define such an object in XAML/WPF? How could such an object be manipulated in 3D, scaled up and down and rotated using C#? ...

WPF UserControl Design Time Size

When creating a UserControl in WPF, I find it convenient to give it some arbitrary Height and Width values so that I can view my changes in the Visual Studio designer. When I run the control, however, I want the Height and Width to be undefined, so that the control will expand to fill whatever container I place it in. How can I acheive t...

WPF Can't Databind to an Interface?

I'm trying to bind controls in a WPF form to an interface and I get a runtime error that it can't find the interface's properties. Here's the class I'm using as a datasource: public interface IPerson { string UserId { get; set; } string UserName { get; set; } string Email { get; set; } } public class Person : EntityBase, I...

How do you do AppBar docking (to screen edge, like WinAmp) in WPF?

Is there any complete guidance on doing AppBar docking (such as locking to the screen edge) in WPF? I understand there are InterOp calls that need to be made, but I'm looking for either a proof of concept based on a simple WPF form, or a componentized version that can be consumed. Related resources: http://www.codeproject.com/KB/dotne...

How to transform a XAML/WPF file to a video (AVI, WMV, etc.)

I have a simple WPF (XAML) file that has some animated shapes and text. The animation has no interactive behavior. I want to record this animation as a video file that I later intend to use as the "intro" screen to a screencast. What I think I need: C# code that takes an input XAML file and spits out a high quality WMV at (for example a...

Text on a ProgressBar in WPF

This may be a no-brainer for the WPF cognoscenti, but I'd like to know if there's a simple way to put text on the WPF ProgressBar. To me, an empty progress bar looks naked. That's screen real estate that could carry a message about what is in progress, or even just add numbers to the representation. Now, WPF is all about containers and e...

Expose DependencyProperty

When developing WPF UserControls, what is the best way to expose a DependencyProperty of a child control as a DependencyProperty of the UserControl? The following example shows how I would currently expose the Text property of a TextBox inside a UserControl. Surely there is a better / simpler way to accomplish this? <UserControl x:Clas...

Should my C# .NET team migrate to Windows Presentation Foundation?

We make infrastructure services (data retrieval and storage) and small smart client applications (fancy reporting mostly) for a commercial bank. Our team is large, 40 odd contractual employees that are C# .NET programmers. We support 50 odd applications and systems that we have developed. A few members of the team began making WPF, WF ...

What is best for desktop widgets (small footprint and pretty graphics)?

If I were to want to create a nice looking widget to stay running in the background with a small memory footprint, where would I start building the windows application. It's goal is to keep an updated list of items off of a web service. Similar to an RSS reader. note: The data layer will be connecting through REST, which I already have...

WPF Data Triggers and Story Boards

I'm trying to trigger a progress animation when ever the ViewModel/Presentation Model is Bussy. I have a IsBussy Property, and the ViewModel is set as the DataContext of the UserControl. What is the best way to trigger a "progressAnimation" story board when the IsBussy property is true? Blend only let med add Event-Triggers on a UserCont...

Enabling embedded controls in a FlowDocument

I have a FlowDocument in a standard WPF application window where I have some text, and in this text some hyperlinks and buttons. The problem is, if I put this FlowDocument inside anything except a FlowDocumentPageViewer the hyperlinks and buttons are disabled ("grayed out"). <FlowDocumentScrollViewer> <FlowDocument> <Paragraph>...

How can I listen to a RoutedEvent from a class that doesn't derive from FrameworkElement ? Can it be done ?

The question says it all basically. I want in a class MyClass to listen to a routed event. Can it be done ? ...

How to Set Grid Column MaxWidth depending on Window or Screen Size in XAML

I guess the title says it all. I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page Width (or ActualWidth) and I would prefer to do this in XAML if possible. This is some sample XAML to play with in XamlPad (or similar) which sh...

Smooth ProgressBar in WPF

I'm using the ProgressBar control in a WPF application and I'm getting this old, Windows 3.1 Progress*Blocks* thing. In VB6, there was a property to show a smooth ProgressBar. Is there such a thing for WPF? ...

In WPF, what is the equivelent of Suspend/ResumeLayout() and BackgroundWorker() from Windows Forms.

If I am in a function in the code behind, and I want to implement displaying a "Loading..." in the status bar the following makes sense, but as we no from WinForms is a NoNo: StatusBarMessageText.Text = "Loading Configuration Settings..."; LoadSettingsGridData(); StatusBarMessageText.Text = "Done"; What we all now from Win...

WPF 3.5 WebBrowser control and ZIndex

I'm trying to figure out why the control does not honor ZIndex. Example 1 - which works fine <Canvas> <Rectangle Canvas.ZIndex="1" Height="400" Width="600" Fill="Yellow"/> <Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/> </Canvas> Example 2 - which does not work <Canvas> <WebBrowser C...

How do I use WPF bindings with RelativeSource?

How do I use RelativeSource with WPF bindings and what are the different use-cases? ...

Designing a WPF map control.

I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this. What I'm thinking of is using a ScrollViewer (sans scroll bars) as my "view port" and then stacking everything up on top of a canvas. From Z-Index=0 up, I'm think...