wpf

What does "{x:Static}" mean in XAML?

What does "{x:Static}" mean in XAML? Code sample: <SolidColorBrush Color="{x:Static SystemColors.ControlColor}" /> ...

FF3 AwesomeBar-like behaviour in WPF

I'm trying to implement behaviour similar to the Firefox 3 AwesomeBar in WPF. I've got a ComboBox to use a DataTemplate that makes the dropdown look like the dropdown for the AwesomeBar, but I'm not sure how to get the right behaviour. What I want to happen is for the user to type their search into the TextBox bit of the ComboBox and th...

Is there any native WPF Multiselect combobox available ?

Even a 3rd party one will do. Thanks ...

How to bind nested objects, or master-detail-binding, in code?

I have a three nested classes, Show, Season and Episode, where a show has seasons, and seasons has episodes. I want to bind two listboxes so that the first lists seasons, and the second lists episodes in that season. How can I do this? I prefer to set this up in code, not xaml, but if you know how to do it with xaml, it's better than ...

How to enable user to drag/drop WPF user controls anywhere on the page?

Now that I can make useful user controls in WPF (thanks to this stackoverflow answer) I want to be able to put numerous user controls on one page in two columns and enable the user to be able to move them around according to preference, dragging the ones they use the most to the top, etc. Can anyone point me to code, tutorials, etc. whi...

Bind to animated property (WPF)

Hi, Does anybody knows, if there is a way to use a property that is animated as source for a binding? As far as I found out, is that an animation doesn't "really" set the value on the property, and therefore doesn't fire the changed events, which is needed to trigger the binding. tia Martin ...

How to put logic into my DataTemplate, e.g. handle a blank address line?

I'm starting to understand XAML data binding and using the DataTemplate and it's pretty nice. What is the best way to take the next step and put logic into the code below, e.g. look to see if there is anything in "Address2" and if so display it, or format foreign addresses differently, etc.? <Window.Resources> <DataTemplate x:Key...

How to move from LINQ to SQL to "LINQ to WCF"?

I'm putting together a WPF application which will eventually use WCF web services as its data source. During the prototyping phase, I'm using LINQ to SQL on an SQL 2008 database and have come to appreciate the ease with which I can do "Add New Item | LINQ to SQL Classes" and generate a model class for a table, then speak to it with LIN...

Showing a window with WPF, Winforms, and Dual monitors

I have a 2 monitors and a WinForm app that launches a WPF window. I want to get the screen that the WinForm is on, and show the WPF window on the same screen. How can I do this? ...

WPF: When is a WrapPanel full.

I'm using a WrapPanel to display variable height items in columns. The wrappanel has a constrained size. Is there an way to determine when the WrapPanel is 'full'? I will then page to another panel with an animation. I've looked at the ArrangeOverride of the items that are the panels children, but they always seem to be getting all...

How do you bring to front a usercontrol added to a canvas in code behind.

I have a series of usercontrols that are added and removed from a canvas in code behind. I need to insure that certain ones are forward of others. How do you set, what used to be the ZOrder in VB6, the order of a user control once it is added to a canvas? ...

combine image and solidcolor background for a WPF Form

I have a WPF form I'm building - I want to specify a background image for the window, which is easy enough. However, I also want to specify a color so that the area of the form not covered by the image is white. I've seen some examples that show using two different background brushes, but when I try that VS.NET tells me I can't have mu...

WPF Maintain Keyboard Focus

I'm creating a UserControl consisting of a TextBox and a ListView. I want keyboard focus to remain with the TextBox as long as the control has keyboard focus (selection changes in the ListView shouldn't remove keyboard focus from the TextBox). I've tried catching GotKeyboardFocus in the ListView and passing keyboard focus back to the Te...

WPF How to use the same template

Well how do i use a template on the TextBox and the PasswordBox atm i have 2 templates defined but thay contain exactly the same content.... ...

WPF event when a window is no longer on top

I have a WPF window (window1) whose owner is window2. If a user clicks on window2, or the desktop, or anything else to make window1 not on top of the z-order, I want to set window1's visibility to hidden. I.e., the window either needs to be on top, or hidden. Is this possible? ...

Datagrid: Auto-generated DataTemplate.. StackPanel does not reflect background color

I used data binding to bind a CLR object to a datagrid (using expression blend). I was prompted to autogenerate a template to hold the data. This created a StackPanel and three TextBlocks. I go to edit the stack panel and attempt to change the various colors. The properties window accepts the change, but the panel in the data grid r...

Wpf -how do i listen to window resizing?

I've got a windows forms map in a WindowsFormsHost, and I need it to resize with the window. I'm just not sure what event to listen to, to do this. I need the map to only resize once the mouse is up, otherwise it lags out, and tries drawing itself a million times when you resize a window really slowly. ...

WPF Toolkit Datagrid with .Net 3.5 no sp1

I've been trying to use the WPF toolkit in a WPF application that I'm deploying internally at my company, but the toolkit needs .Net 3.5 sp1. The only difference between sp0 and sp1 for the toolkit is the MultiSelector class that the datagrid uses. My question is, does anybody know of a workaround for this so sp1 isn't required? Is ther...

How do you get data from controls on pages on a Tab Control

I've got a WPF tab control that contain several duplicate controls as Tab Page content <TabControl ItemsSource="{Binding}" Name="tabControl"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"/> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> ...

Applying in-place tranformations to 3D Model in WPF

I have a simple 3D cube that I can rotate using the following code: void mui3D_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { RotateTransform3D rotation = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0), mui.Model.Bounds.Location); DoubleAnimation rotateAnim = ne...