wpf

Get removed elements in InkCanvas

Hi, I was wonder if there was any method in which I can access an element which the user removes. For example when the InkCanvas is set to Select users can select elements and press delete to remove them. Is there any way of getting to this item if they deleted it? Any help is much appreciated. Cheers, Nilu Update @Drew: Not really...

How can you bind an Indexed property to a control in WPF

Given an instance of the class ThisClassShouldBeTheDataContext as the Datacontext for the view class ThisClassShouldBeTheDataContext { public Contacts Contacts {get;set;} } class Contacts { public IEnumerable<Person> Persons {get;set;} public Person this[string Name] { get { var p = from i in Persons where i.Name...

Integrating Modules with Application in Prism aka CompositeWpf

From MSDN: It is likely that most of the views in your modules will not have to be displayed directly, but only after some action by the user. Depending on the style of application, you may want to use menus, toolbars, or other navigation strategies for your users to access views. In the initialization method of the module, you can a...

Set a Row to Bold in Listview in WPF

I have a Listview like the Address book in outlook. and it looks like Name Phone ---------------------------- Everyone User1 12345 User2 54321 User3 98765 I need the row "Everyone" to Bold letters. And my listview is <ListView Name="lvContacts" Grid.Row="2" Grid....

Are MVVM Patterns in WPF and Silverlight identical?

I really appreciate the question (and answers) we already have in “List of WPF functionalities that aren’t in Silverlight 3.” My allegedly new question narrows down the differences between WPF and Silverlight into the context of MVVM. Based on a Shawn Wildermuth MVVM sample project I downloaded from MSDN, I do see that, as of Silverlight...

Creating high performance animations in WPF

Hi All, I'm in a situation that requires many animations with effects like transparency to be applied but when there are about 10 of them running, my application slows down to a grinding halt! :( I also, tried implementing a particle like effect using a frame by frame manual animation using the CompositionTarget.Rendering event, which ...

I want to strikeout the contents of a xamdatagrid in MVVM model

I want to strikeout the contents of a xamdatagrid in MVVM model.I am using TextBlock.Textdecoration="Strikethrough" but it is not working.Can anyone please give me the solution. ...

Access to DataTemplate Control of WPF Toolkit DataGridCell at Runtime, How?

I have a DataGrid defined with WPF Toolkit. The CellEditingTemplate of this DataGrid is associated at runtime with a custom function that build a FrameworkElementFactory element. Now I have to access to control that is inserted inside DataTemplate of CellEditingTempleta, but I do not know how to do. On web I found a useful ListView Hel...

WPF Printing Flow Document

Greetings, I have a problem with printing in WPF. I am creating a flow document and add some controls to that flow document. Print Preview works ok and i have no problem with printing from a print preview window. The problem exists when I print directly to the printer without a print preview. But what is more surprisingly - when I us...

Double buffering in WPF?

hi guys, I'm developing a graph control in WPF. I have previously developed it using GDI and C#. i've used double buffering in previous control to avoid some issues related to redrawing of the graph control. Now when i've developed the Graph Control in WPF i have a problem, when i use my Graph Control as a user control in a windows form...

Is there a Spy++ like utility for WPF?

As a “hardcore” WinForms programmer from a Win32 background I have always used Spy++ to understand what my applications are doing at the UI level including: Seeing what events the controls are sending to each other. Seeing the control tree at run time Finding the control that is drawing part of the display I then often search for ...

WPF ContextMenu Design. How to set Background in WPF MenuItem?

I create popup menu like this. <DockPanel.ContextMenu> <ContextMenu Background="#CD252220" Opacity="0.95" Foreground="LightGray" BorderBrush="DarkGray"> <MenuItem Header="_Save Image..." x:Name="btSave" IsEnabled="False" Click="btSave_Click" Style="{StaticResource MyStyle}"> <MenuItem.Icon> <Image...

Setting WPF text to TextBlock

I know that TextBlock can present FlowDocument, for example: <TextBlock Name="txtFont"> <Run Foreground="Maroon" FontFamily="Courier New" FontSize="24">Courier New 24</Run> </TextBlock> I would like to know how to set FlowDocument that is stored in a variable to a TextBlock. I am looking for something like: string text = "<Run F...

How to place a long Grid in a WPF Layout Container?

When I place a Datagrid in a WPF Grid Layout container, the datagrid lengthens the Grid Layout. I want it to occupy only the space available on screen. ...

Is it possible find topics from xps document in document viewer through code in WPF?

Hi, Can anyone suggest, is it possible to put focus on a particular topic in xps document in document viewer though code. I am unable to find anything.So can anyone suggest is it possible to find anything like that. Thanks, ...

In WPF, why does my Style in Generic.xaml not get applied to my Custom Control?

In WPF, I have a custom control that inherits from TreeView. The code is as follows... public class CustomTRV : TreeView { static CustomTRV() { //Removed this because I want the default TreeView look. //......CustomTRV.DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomTRV), new FrameworkPropertyMetadata(typeo...

How to add a Column ContextMenu in the WPF DataGrid

Hello, I'm trying to add a context menu to a column in the WPF datagrid and don't quite see how this is possible. I know how to add one to the datagrid, but I would like to have different menu items based on the column as well have the menu click event be aware of column or better yet the cell that the context menu was choosen for. My...

Many connections vs. big data queries

Hello I am creating a windows application that will be installed in 10 computers that will access the same database thru Entity Framework. I was wondering what's better: Spread the queries into packets (i.e. load contact then attach the included navigation properties - [DataContext.Contacts.Include("Phone"]). Load everything in one qu...

WPF conditional resource selection

hi all, I want to change back Color (or any other visual properties) on my control based on a boolean statement made from properties in the datacontext of the object . let me explain it with an example : public class Node { public int Min ; public int Max ; } and then I have a wpf control like : <DockPanel x:Name="LayoutRoot...

Custom Controls

I seem to be having problems with custom controls in WPF. I want to have a simple validating textbox where I can only put doubles. In Forms it was easy, just create a custom control, inherit from TextBox and handle the appropriate events. Is this the way to go in WPF? I can make a custom control, inherit from TextBox, it compiles, but it...