wpf

WPF Combobox with auto-complete/auto-filter?

I am eager to find some solid (free, Open Source, or tutorial/example) code to make a WPF Combobox do autocomlete/autofilter as the user types. But everything I've tried so far has had some sort of problem... A Reusable WPF Autocomplete TextBox came close, but I can't get it to work with more than one filter (more info here). WPF autoc...

How to keep a ContextMenu visible behind a modal dialog

I'm working on a WPF application which has a dropdown button. When "expanded", it displays a custom UserControl inside a ContextMenu. This control includes two buttons, one for Open and one for Save. The idea is for each of these buttons to display the appropriate file dialog. My problem is that, when the dialog is displayed, the Con...

Styling the Validation Error on WPF DataGridCell

I'm trying to change the way a DataGridCell appears when it has error content. By default, it has a white background and a red border when it encounters an error. However, it seems that my attempts to set the Validation.ErrorTemplate of this class are being ignored, as are my Triggers on the Validation.HasError property. All of the co...

How to refresh WPF chart I'm using to display some data (WPF toolkit chart)

How do you update a WPF chart when the collection changes? I am using WPF chart (System.Windows.Controls.DataVisualization.Toolkit.dllversion version 3.5.50211.1) to plot some simple data. The classes for the data look like this: public class EngineMeasurementCollection : Collection<EngineMeasurement> { } public class EngineMeasure...

WPF TextBox Border when selected ?

Hi, I want to make a WPF TextBox have a DarkBlue border and thickness equal to 1. I want to make the WPF have this border ( DarkBlue, thickness set to 1 ) even when the TextBox is selected. I tried doing this task by the following code. However, it doesn't work at all. Any ideas or hints ? Any help would be greatly appreciated. <S...

How to change a ListBox's Vertical Scrollbar's Repeat Button Size in WPF

Hi there, I have a ListBox control with a vertical scrollbar. I would like to increase the Repeat Buttons' Height to something bigger because our UI is touch-compatible. Is there a simple way to do it ? Thank you and best regards, Romanin ...

WPF UI Related question

hi all. realy i don't know what i should title this problem, i hope to "WPF UI Related question" is accept able. consider something like that form who you explore a class diagram in Visual Studio. you select any class object in window and than right click on it then you select "Properties" menu Item and then a window will pups up that al...

How to make a quick interface to edit / delete / add the database?

I have the database mysql. I need to access it via a desktop application with the ability to change does not have value. in asp.net is there, this dynamic data filter, I need the same thing but in WPF. ...

Memory Leak with CollectionViewSource.GetDefaultView() in WPF?

I'm wondering what the best practices are for working with CollectionViews in WPF in particular the use of the CollectionViewSource.GetDefaultView() method. Has anyone run into any problems with using GetDefaultView? We're concerned that it may be causing some memory leaks. Is it generally a better practice to create ListCollectionView...

I need to know how to add a using directive or an assembly reference for a Usercontrol.

We have some code that we tried out on a WPF project in .net 4.0 and it worked with using Windows but we re started the project to combine everything together and now we have started to take advantage of the UserControls. My Window that worked with my previous code doesn't work with this new UserControl code and it says what I posted in...

How to perform Single click checkbox selection in WPF DataGrid?

I have a DataGrid with first column as text column and second column as CheckBox column. What I want is, if I click the check box. It should get checked. But, it takes two click to get selected, for first click the cell is getting selected, for the second clicks the check box is getting checked. How to make the check box to get checked/u...

HorizontalContentAlignment of SelectedItem not stretching perfectly

I made a custom styled list in WPF: <DataTemplate x:Key="SelectedTemplate"> <StackPanel Background="#FF4E4E4E" HorizontalAlignment="Stretch"> <TextBlock Text="{Binding Path=Title}" Foreground="#FFD80000" /> </StackPanel> </DataTemplate> <Sty...

WPF - XamlParseException when unit testing method in Window class

I'm trying to use MSTest to write unit tests for methods in my MainWindow class in my WPF application. However, I get the following exception: System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '127' and line position '32'. ---> System.Exception: Cann...

Modify or 'tweak' an existing TreeViewItem control template - Take II

Ok, this is sort of a follow-up to my first question http://stackoverflow.com/questions/3827701/modify-or-tweak-an-existing-treeviewitem-control-template but since it is technically a new question, I'm told a good S/O visitor should create a new one, so here it is! Ok... the existing template for a TreeViewItem is based on a grid, a bor...

WPF MVVM Updating UI Bound properties from BackgroundWorker

Are there any potential issues with updating UI bound properties of the ViewModel from the Backgroundworker? I am trying to update the VM while it is bound to the UI, and potentially users might be typing in.. how does the the synchronization work here (I don't think I can use Lock statements from XAML). Thanks in advance.. ...

WPF DataGrid is extremly slow, how can I improve the Initial Loading time ?

Hello, I have a Window with a DataGrid showing grouped Data. I am loading around 4 x 300 items in the WPF DataGrid which are grouped in 4 groups. Grouping disables Virtualization. I set IsAsync="True" so my Window opens fast but the DataGrid is just filled AFTER 11 SECONDS ??? What can I do to speed up the loading/display of my data...

Get element that stole focus before it does in WPF.

To be clearer. I need to know which element stole focus in the focused element LostFocus event. Something like this: I have 3 buttons: A, B and C "Button A" has focus "Button C" is clicked "Button A" LostFocus event is triggered In there I want to know that "Button C" stole the focus (Could've also been "Button B") Let me know if the...

WPF - Changing Animation Path

I have a MatrixAnimationUsingPath that animates an arrow moving along a path... In my code behind within the MainWindow I am setting the PathGeometry to a given PathGeometry. This works fine and when everything loads the arrow is moving along the path fine... But when the user clicks a button - in the button handler I need to change the...

WPF: What can cause a ComboBox to not virtualize?

This is my combobox. It doesn't seem to be virtualizing, but I cannot figure out why. Do you know of anything that would cause this? <ComboBox Grid.Row="0" Grid.Column="2" SelectedValuePath="PrimaryKey" SelectedValue="{Binding CustomerKey}" ItemsSource="{Binding CustomerCanidates}"> <ComboBox.ItemsPanel> <Item...

Problems binding Self-Tracking Entity's Navigation Property WPF

I have a WPF application consuming data using Entity Framework 4 and Self-Tracking Entities. In which I have a window with 2 controls in it, one that shows the "Details" portion of an object using a ContentControl and templates from a merged resource dictionary. Another with a ListBox of Groups the object in question belongs to and a Com...