wpf

Why doesn't the Validation.Error event get fired in this case?

I have copied an example from MSDN and added the Validation.Error event. Problem is, it never gets fired. Why not? <UserControl x:Class="MeasurementControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxm...

Adding logic to a data bound property to initiate animations in WPF

I feel like this is a very simple question, but I can't really find any examples on the internet of anyone who wants to do something like this. What I have right now is a half circle gauge control that I made in WPF. I have a RotateTransform that has data bound to its angle so as the data comes in it shows the angle visually. The problem...

How to force Visual Studio 2010 to ignore a WPF XAML declared DataContext at design time?

Quite often I will set up WPF UserControl with a declarative DataContext: <UserControl...> <UserControl.DataContext> <local:SomeModel x:Name="Model" /> </UserControl.DataContext> </UserControl> When in design mode, Visual Studio will attempt to instantiate the DataContext. However, when the DataContext is pulling data ...

Center of Rotation on ScatterViewItem

I have a ScatterViewItem and would like to change the rotation center to be to the right rather than the center of the rectangle. Is there any way to accomplish this in WPF? Thanks ...

How to write DataTemplate to display xaml

Hi, I need to display xaml code in a panel, how do I write DataTemplates to format the xaml with proper indentation and hyperlinks for references (such as StaticResource etc), for example, <ListBox ItemsSource="{Binding}" ItemTemplateSelector="{StaticResource ResourceKey=selector}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> ...

WPF image next to text + mouse over

Hi everyone, I'm a noobie when it comes to WPF xaml so i'm hoping my question is so easy it can be answered in one line. I'm looking for the best way to display an icon next to a block of text. When a user hovers over the block of text or the icon i want to change the icon to another one. Also, is it best practice to create one ima...

Photo Collage: How to reduce memory consumption?

Hi, i am working on an WPF image viewer with a photo collage mode. Therefore some images from a folder on hdd should be displayed on random positions on a canvas by adding image after imaging in a certain time interval. The images have a fixed target size, which they should be scaled to, but they should keep their aspect ratio. At the ...

Binding RectangleGeometry.Rect doesn't show the rectangle

I'm having an issue trying to bind to a RectangleGeometry's Rect property. The basic idea here is that I'm attempting to bind a clip mask to control the visualized height of a pseudo-chart object. Here's the XAML: <Path x:Name="_value" Fill="{DynamicResource PositiveColorBrush}" Data="F1 M10,55 C10,57.75 7.75,60 5,60 2.25,60 0,57.75...

Fastest Way to extract from SQL Lite in C#

We have a single table (25 columns int, text and datetime) with about a million of recrds, and we need to extract them from a SQL Lite database and then render to a wpf xamDataGrid, What is the fastest way of doing it in C#? PLUS, what would be the most efficient way of doing it? Options we have thought about: Getting a DataSet List ...

ListBox ItemTemplate is fickle with CLR and UserControl data

I wrote a simple UpDown UserControl for my application. I am rendering it in a ListBox so that as UpDown controls get added, they stack up horizontally. My UserControl has one DependencyProperty that corresponds to the number inside of the UpDown control, called NumberProperty. I add multiple UpDown controls to the ListBox via databin...

WPF: what's the most efficient/fast way of adding items to a ListView ?

I need to display lots of rows in a grid added at a pretty high frequency (up to 10 rows per second in some cases) I chose ListView because I assume is the fastest grid control in WPF. (certainly a lot faster than GridView) CPU utilization gets pretty high after couple hundred thousand items were added and they continue to come in. This...

does Silverlight have more graph/charting capabilities than WPF?

In terms of making a decision between WPF or Silverlight for an application does Silverlight have more graph/charting capabilities than WPF? Would this be a factor (in terms of additional cost/effort with WPF to build/buy charting components) ...

Is there any way to prevent a WPF CheckBox from firing its Checked event?

I have a group of WPF CheckBoxes that have a Checked event handler that handles some logic when the user clicks on one of them. However, I also have a "Clear All" button that, when clicked, will clear all the checkboxes. If the user clicks on the "Clear All" button, I do NOT want the checkboxes to fire their Checked event. Is there a way...

test Wpf Control performance

Specifically for data binding and templates, is there a good way to test the performance of my controls in these respects. I would like to know how much time applying the template and initializing the data binding takes. I am using both Wpf Performance Suite and ANTS Profiler but neither seems to provide information on these aspects. ...

Listbox ScrollIntoView problem wpf

Hi All, I am creating a listbox with itemsource of type dataview. I want to scroll the listbox to praticular item which is not selected. I am using the following code for selected item. Code: Binding listbox: DataView dv = newDt.DefaultView; dv.Sort = "Count Desc"; lbResult.DataContext = dv; To get the row...

How can I discover my end user's users' system performance settings?

How can I discover my end users' system performance settings (visual effects, etc.)? I want to make my WPF application compatible with those settings. Is there any standard routine to do this or do I just have to read sysinfo? ...

Grouping with collectionviewsource based on 2 columns

Hi I've a collection with itemname and header, and I've to group based on header, and if the header is empty the group style must be a button, or else it should give expander and the itemnames as its content. {itemname="cadbury" header="choclates"} {itemname="5 star" header="choclates"} {itemname="Flapjack" header=""} {itemanem="ford" h...

Creating Images as buttons in code in C# WPF

I want to create an image as a button in code in C# WPF (not a button with BG image but an actual image). I read on this site to use a PictureBox for the image, and I've found that the WPF equivalent is Image. The problem is, that while i've found PictureBox has a .Click that you can set, Image does not. The two things I want to do are: ...

Drawing In Wpf Aplication

I Want Draw 1 000 000 line In Wpf Application But When I Draw To MeshGeometry3D It Is Slow How Increse Speed On Draing 1 000 000 Lines 1 000 000 iS Number Of Line ...

WPFToolkit DataGrid/Listview column Traversing?

Any hands on example for implmenting the Traversing of the DataGrid/Listview colum element if the column has a DataTemplate applied with TextBox?. ...