wpf

wpf: problem with generated resource names

Afternoon folks. I have a .csproj file which contains some xaml resource dictionaries and a wpf application containing merged resource dictionaries, like the following: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Resources/ComboBox.xaml" /> ...

Animating Grid Column or Grid Row in XAML?

Is there any way i can animate Grid column width or Grid row height from XAML? ...

Spanning a Record Over Multiple Rows in WPF Toolkit's DataGrid

Hello, Is it possible to style WPF Toolkit's DataGrid so a data record can span multiple rows. Example screen shot from a commercial control. Thanks, Ben ...

Raising ContextMenuClosing event manually

Hello, I'm deriving from ContextMenu and inside the derived class I need to raise the ContextMenuClosing event manually. I tried the following two ways: // On runtime tells me it can't convert from // "System.Windows.RoutedEventArgs" to // "System.Windows.Controls.ContextMenuEventArgs" RaiseEvent(new RoutedEventArgs(ContextMenuClosi...

Binding in WPF style causes inexplicable "Cannot find governing FrameworkElement" error

I have an ItemsControl that displays a bunch rectangles. Each rectangle needs to be offset upward and to the left. So, I created a RectangleStyle that uses bindings to set the width, height, X translation, and Y translation for a rectangle. The width and height bindings are working fine, but I'm getting the following error for the Tran...

WPF Slideshow and photo gallery

I want to create an image slideshow using WPF and C#, but I don`t know how to do this. I want to do it automatically (change picture after time) and also by buttons that user can click on ... ...

How do you get the level of a treeviewitem in WPF C#?

How do you get the level of a treeviewitem in WPF C#? In windows forms there is a .Level member of the treeview class but there does not seem to be one for WPF C#. ...

WPF Timer problem... Cannot get correct millisecond tick.

Hi, I have a basic question regarding timers. My timer is acting very strange. I am trying to make the tick occur every millisecond to update my data. I can get it to work with seconds, it seems, but not milliseconds.. I am using WPF and am wondering why the following is not functioning correctly. It appears that the "second" countdow...

Setting XAML property value to user control

I have a user control in WPF which i want the text of one of it's labels to be read from the XAML where it is used. Hence.. My User Control: <UserControl x:Class="muc"> <Label Foreground="#FF7800" FontSize="20" FontWeight="Bold"> <Label.Content> <Binding ElementName="TestName" Path="." />...

Simple WPF 4 Question: DataGrid of List of Objects is showing no records

This is driving me nuts. I have a datagrid in WPF that is not populating with records at runtime. Here is the XAML. I've done this before in Silverlight although I am a newbie and can't quite figure out what is missing. <DataGrid AutoGenerateColumns="True" Height="335" HorizontalAlignment="Left" Name="DataGrid1" VerticalAlignment="To...

[WPF] GridViewColumnHeader confusion

Why would that work: <Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Background" Value="LightBlue"/> </Style> And not this? <ListView.View> <GridView> <GridView.ColumnHeaderContainerStyle> <Style> <Setter Property="Background" Value="Orange" /> ...

AvalonDock - Bind MenuItem to State of DockableContent

I'm using AvalonDock to layout my application. I want to create a "View" MenuItem with a checkable MenuItem for each of my DockableContents that will show/hide each item. I'm not finding an example of anyone doing this, and it appears to me the State property is readonly, making it not possible to create a 2-way binding to the MenuItem...

C# WPF Perform action while button down

How can I detect that the button in my application is still clicked (down)? and how to know when it is released? ...

SFML in a WPF control?

I've recently chosen to pursue the possibility of using SFML in a WPF control. I've heard about something relating to the WindowsFormsHost class, in that I should render to a Win32 window and use the aforementioned class to display that in a WPF element. I read there were serious issues regarding speed related to that method, so I was wo...

DataGridTemplateColumn doesn't support direct content?

I know I did this in Silverlight... In WPF 4 I am trying to put controls in a DataGridTemplateColumn element in DataGrid XAML I can't add anything to it and I get errors saying it doesn't support direct content. WTF? I want to put in maybe a hyperlink, textboxes, a button, etc. I can't even add a canvas. ...

C#, WPF, Visual Studio 4: irregular shape color filling

I am creating a Paint application with C#, WPF, and Visual Studio 4. Just like MS Paint, the user can draw lines and shapes. How do I fill a user drawn irregular shape with color? Is there a library for doing something like this? Detecting a closed loop that is created by lines seem like an impractical approach. I can imagine all ...

Inline toolbar usability

Hi, I have an entity that can be modified, saved and deleted and so it would be fitting that it would have a toolbar at the top of the window that you can press one of those action buttons. The parent entity can be submitted. However, this entity also has child entities that can be modified, saved and deleted. Is it usability best prac...

Why isn't my WPF closing event being fired for system closes?

I have the following line in my Window stanza in the XAML file: Closing="Window_Closing" I originally thought that the web page here assured me that this event fires when you use the big X close method, Alt-F4 or close from the system menu yet that doesn't appear to be the case since my breakpoint on the Window_Closing() function ...

Scrollviewer Problem wpf

Hi All, I am displaying images inside the listbox. i have placed this listbox inside the scrollviewer. I am using two repeat button to move the listbox items. I am binding the listbox using datacontext. Problem: If i move the images using the button and click on the image in the lisbox it moves to the initial position. Code: <Rep...

Keeping track of dependency property value changes at global level

Hi, I am having a number of controls in my application(which user can add to canvas), each having various properties(mostly dependency properties). User can change its properties through property grid(like color, text etc.). I have save functionality implemented, so if user makes any change in canvas we ask him to save the document bef...