wpf

WPF: Routed events or regular events?

In WPF we have routed events. When should these be used instead of regular events? ...

WPF Organization Tree/Chart Control or hookup?

Q1. Which would be the best resource or tutorial to setup a simple WPF Organization Chart or Tree for an organization object (self referencing).I would like to have a button when clicked which would show an organization chart (hierarchical) tree of the various departments and sub-department.I'm looking for a base to start code + control....

Problems in dynamically generating an Image in silverlight

I am dynamically adding an image to a canvas object which was working for a while and suddenly stopped displaying for some particular reason. Here is the code : public void shootProjectile() { var projectileImage = new Image(); var currChar = (CharactersRef.SCharacterProjectile)lstSubMenu.SelectedItem; projectileImage.Name...

Is WPF an ECMA standard library?

Is WPF an ECMA standard library? Or it is just a part of MS .net implementation? Any references please? ...

WPF: ComboBoxItem background

Hi all, I have a ComboBox based on XML file data: <Root> <Node Background="Yellow" Foreground="Cyan" Image="1.ico" Property="aaaa" Value="28" /> <Node Background="SlateBlue" Foreground="Black" Image="2.ico" Property="bbbb" Value="2.5" /> <Node Background="Teal" Foreground="Green" Image="3.ico" Property="cccc" Value="4.0" /> <Node Backg...

WPF and initial focus

It seems that when a WPF application starts, nothing has focus. This is really weird. Every other framework I've used does just what you'd expect: puts initial focus on the first control in the tab order. But I've confirmed that it's WPF, not just my app -- if I create a new Window, and just put a TextBox in it, and run the app, the Tex...

What .sdf files. How it is diffrent from .mdf files.Does it works with linq to Sql?

I am playing with wpf and when i have created database it is created with the .sdf files. I want to know details of .sdf files. How it is diffrent then the standard .mdf files and will they support linq to sql? Because i am not able to use it with linq files. ...

Using WPF on a DLL to create Images Dynamically (instead of GDI+)

I need to generate an image dynamically, and after I read the tutorial here I realize i can use all the controls and layouts from WPF to generate my rendering, and then save it as a JPG. The idea is to use this instead of GDI+, which is quite primitive. The question is, how to I create a regular dll file that would generate programatic...

Remove focus rectangle on a UserControl

I have a WPF UserControl with Focusable="True". It's the only focusable control in the window. Whenever the user presses Tab or Alt (and especially when they Alt+Tab to another application), my UserControl acquires a dotted-line border, aka focus rectangle. The focus rectangle then stays there until the window is closed. How can I prev...

WPF: ListBox with WrapPanel, vertical scrolling problem

I have a UserControl (XAML below) that has a ListBox that I want to display images inside a WrapPanel, where images are displayed as many as will fit on one row and then wrap onto the next row etc. It works, except when the ListBox grows higher than the available space in the window, I'm not getting a vertical scrollbar, i.e. the content...

Force a WPF control to refresh?

we have two textBlock like this: (we used .NET FW 3.0) <TextBlock Grid.Column="0" Name="tabName" Style="{StaticResource textBlockBarStyle}" HorizontalAlignment="Left"> <TextBlock.Margin> <Binding Converter="{StaticResource dpiConverter}"> ...

How to load a new user control without opening a new window in WPF?

I put together http://tanguay.info/web/index.php?pg=codeExamples&amp;id=164 which reads an XML file of customers, allows the user to edit them and saves it back, and it all works well. However, when the user clicks Save on the "manage customers" page, I want the application to "go back" to the "show customers" page. The "pages" are...

In WPF, how do I get the content of a tabItem to fill available space?

I do not know what I am doing wrong here. In the XAML below, the Border does not fill the available space on the tabItem (just lots of whitespace). How do I fill the entire tab page? <TabControl> <TabItem Header="Plant State"> <Border Background="Red" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></Border> </...

How to find the position of a FlowDocument Inline or Block element relative to a UIElement?

I am trying to implement features similar to Visual Studio like code region expander/collapser for FlowDocument content. For this, I need to know, for instance, the Y coordinates of where exactly a paragraph begins and ends so that I can draw the adornments. How do I get this information? Here's what I tried: I implemented an invisible ...

Access DataContext in code-behind

Beware, this is a rather basic question (I think). I have a UserControl, called MyUserControl. I use it in a DataTemplate for my ListBox: <l:MyUserControl DataContext="Test" /> Now I want to access this DataContext in the code-behind of MyUserControl, and I expect DataContext to contain a string object with contents "Test". However, ...

How to disable XP themes in WPF application ?

I have a WPF application (.NET 3.0, VS2008) that displays data in a tab control. Custom colors are required on virtually all controls in this application : basically white foreground and green background. My problem is that when an XP theme (say Luna) is active, it is automatically applied to render controls so that my white text is wri...

Why does ItemsControl show a focus rectangle when its parent is focused?

WPF's ItemsControl will display a focus rectangle when it thinks it has focus and the user presses Tab or Alt. But I recently had an ItemsControl display a focus rectangle even though it did not have focus -- one of its parents did. The ItemsControl was inside a UserControl, which was inside another UserControl that did have focus. Some...

How to access a WPF control located in a ControlTemplate?

Usually, the WPF controls are declared in the .xaml files and not in the code behind (.xaml.cs files). However, sometimes I need to use some of those controls in code behind in order to manipulate them. How can I get the handle of such a control if it "resides" in the xaml file? ...

WPF: CustomControls vs UserControls

In WPF, what is the differences between CustomControls and UserControls? When should I use each? ...

What are your strategies for using Expression Blend on complex, decoupled WPF applications?

I've been doing WPF applications with the MVVM pattern using Visual Studio, coding C# and XAML mostly by hand. Now I've gotten up to speed with Expression Blend so that I can click together WPF applications quickly just using the GUI, which is very nice, much more control of the layout than fiddling around with all the XAML elements 80%...