wpf

Finding which part of an ListBox ItemTemplate was double clicked

Hi, I have a data bound ListBox that uses a custom ItemTemplate to display my stuff. The ItemTemplate has a 4x2 grid that contains different elements. Now I want my users to be able to get at different pieces of data, depending on the subitem they double click - so if they double click the image in row 0, column 0, they get one window....

How can I draw a concave corner rectangle in WPF?

How can I draw a concave corner rectangle in WPF? ...

Silverlight DataBinding Error - Works in WPF Though!

Start a new Silverlight application... and in the code behind (in the "Loaded" event), put this code: // This will *NOT* cause an error. this.LayoutRoot.DataContext = new string[5]; But... // This *WILL* cause an error! this.LayoutRoot.DataContext = this; The error that is raised is "Value does not fall within the expected range." ...

Synchronizing scroll positions for 2 WPF DataGrids

I am trying to synchronize the horizontal scroll position of 2 WPF DataGrid controls. I am subscribing to the ScrollChanged event of the first DataGrid: <toolkit:DataGrid x:Name="SourceGrid" ScrollViewer.ScrollChanged="SourceGrid_ScrollChanged"> I have a second DataGrid: <toolkit:DataGrid x:Name="TargetGrid"> In the event handler ...

WPF Documentation and Visual Studio 2008 Express

I'm trying to get a WPF development environment set up at home, using Visual C# Express 2008. I installed both it and the MSDN documentation for it, however it looks like the documentation doesn't include any WPF documentation. I was about to install the Windows Vista SDK, however it looks like that only includes the documentation for ....

Timers, UI Frameworks and bad coupling - Any Ideas?

Hi, I've just written a small XBox 360 Wireless Controller managed interface that basically wraps around the low-lever SlimDX wrapper library and provides a easy, managed API for the XBOX 360 controller. Internally, the class polls the gamepad every N ms, and shoots events as it detects changes in the underlying state of the controller....

Dragging an image in WPF

I'm trying to create a WPF application where I can drag an image around. Currently I have an image placed in the center of the window, and I'm thinking of using the three mouseevents MouseDown, MouseMove and MouseUp to calculate the new position when dragging the image. Are there any other good ideas on how to do this? I'm totally new ...

WPF - HeaderStringFormat Doesn't work in Expander

I can't seem to find the magic combination to make the HeaderStringFormat work for a WPF Expander. Here are all the things I've tried: <Expander Header="{Binding Path=MyProperty, StringFormat=Stuff: ({0})}" > <TextBlock Text="Some Content" /> </Expander> <Expander HeaderStringFormat="{}Stuff ({0})" Header="{Binding Path=MyProperty...

Why did I get an error with my XmlSerializer?

I made a couple of changes to my working app and started getting the following error at this line of code. Dim Deserializer As New Serialization.XmlSerializer(GetType(Groups)) And here is the error. BindingFailure was detected Message: The assembly with display name 'FUSE.XmlSerializers' failed to load in the 'LoadFrom' bind...

Currency formatting on ComboBox items

I have a ComboBox bound to an ObservableCollection of decimals. What is the correct way to apply our currency converter to the items? Edit: a) I have an existing currency converter that I must use b) .NET 3.0 Do I need to template the items? ...

WPF TwoWay Bind to current source with Converter?

Is there an issue with databinding in WPF when you bind to the current source (Path=".") and using a converter? The two way binding doesn't seem to work in this situation. I know I could change the path, but I want to be able to pass the "Name" value to the converter. I can't get the following example to work: <Window x:Class="WpfTest...

WPF GroupBox hide/show?

Is there a control like System.Windows.Controls.GroupBox that can hide its contents and show only the name and an expander button? ...

Problem with WPF data binding and Access Keys

Please consider the following example. Note that in the real-word, the binding source will likely be a data object. I'm using a TextBlock for simplicity. <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height=...

Using a WPF Custom Control, How can I give my custom control a name to access it via the code behind?

When I try using a Name="id" and\or x:name="id" I get a compiler error: The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. When I don't have this specified my control runs just fine. Any suggestions? ...

WPF User Control's DataContext is Null

I have a user control where the XAML of the control can bind to the appropriate properties from the parent's data context like normal (the data context propagates in xaml). For example, I have a window whose DataContext I am setting to ObjectA for example. My user control within the window is then try to access the properties within th...

WPF ListView Very Slow Performance - Why? (ElementHost, or Other Reason?)

I have a Windows Forms app, that has a single ElementHost containing a WPF UserControl... in my WPF, I have a VERY simple ListView: <ListView Margin="4" ItemsSource="{Binding Notifications}"> <ListView.View> <GridView> <GridViewColumn Header="FirstName" DisplayMemberBinding="{Binding FirstName}" /> <GridViewColumn H...

Using a WPF toolkit DatePicker as a parameter to an ObjectDataProvider used as an itemssource

This one has me beat; I have a WPF window with two (important for this case) controls, both from the WPF toolkit available at CodePlex; A DatePicker and a DataGrid. The DataContext of this window is set to a CLR object that has all the information it needs. This CLR object has a large list of data, and a method called GetDataForDate( D...

How to get started with Microsoft Surface

If I wanted to get a pilot project off the ground using Microsoft Surface, where or who do I ask for testing hardware? ...

WPF: TIFF images with JPEG compression?

I have a large number of TIFF images that I’d need to use in a WPF program (.NET 3.5 SP1 specifically and using C#). Half of the TIFF files contain color images encoded using JPEG compression and they don’t work with WPF. The “Microsoft Office Document Imaging” application handles the files fine. As Windows itself doesn’t really like the...

c# How can I expand an item within a ListView to occupy multiple lines?

Currently I have a ListView (using the Details View). I would like to implement the behaviour whereby when a user selects a single item (log entry) the log entry expands (from one line to multiple lines) to provide more detailed information about the error that occured. My question is this: Is this possible? If so, is there a good resou...