wpf

Navigation in MVVM based application

we are designing a xbap application that has complex, user configurable navigation flow that depend on state of the model\user security etc and some other environmental factors. The application is having a container view that loads user specific controls inside a Frame, i am wondering whats the preferred practice for having the navigati...

WPF Refresh Model on binding

Hey, I was wondering if there was a way of calling a method or updating a property on my ViewModel object when WPF binds to the object ? The reason I want to do this is that when my viewModel objects get created their data model only contains an ID that is used to query data from the database when necessary. So when the user navigates t...

ComponentResourceKey as DynamicResource problem

Hi, I'm seeing some unexpected behavior using ComponentResourceKey. The problem came up because I was using names used in the SystemColors class. Consider the following code: First I expose a ComponentResourceKey in a as a static property: public enum ColorKeys { ControlColor } public class MyColors { public static Compon...

Blend 3 - States ??

Hi! I've just downloaded Expression Blend 3 from DreamSpark (for free because I'm a student :)) and read about states. I came across this and I was very impressed. And then I tried it on my own, I created a style, created a template, simply selected a button - but I cannot make those default styles like MouseOver, Pressed, etc. appear i...

WPF animation on a ListBox

Hi, Do you know any example of how to animate the insertion of an item on a ListBox? The effect I was thinking of is something like: At first we have items A and B on the ListBox. Than a C item is inserted between A and B. In the effect I imagined, before C is inserted, A and B become gradually more distant until a C element fits in ...

Remote method call with shared objects in WPF?

Hi, I need to do a conceptually simple thing: Call a remote method from a WPF application to the server. But I need to share the model types with both sides.. I mean, I need to send a Person object as parameter from the client and also receive objects of the same type. What's the best way? Is it to use WCF? Is there a better way? Do y...

How do you port a theme from Silverlight to WPF?

It's "easy"! I just came across this blog post by Rudi Grobler that says it's "easy" to port a theme from Silverlight to WPF. Unfortunately, he doesn't say how to do it. Download and install I have installed both the WPF Toolkit and Silverlight Toolkit from Codeplex. I also went and dug up the source code for the theme I'm interest...

How can I copy WPF FlowDocument InlineUIContainer contents?

I have a WPF FlowDocument that has a few InlineUIContainers, these are simple InlineUIContainers, that contain a styled button with some text in the Button.Content. When I copy the text and InlineUIContainer containing the button from the FlowDocument to a TextBox, the button is not copied. It is possible to somehow convert the inline ...

How can I detect if Dispatcher.DisableProcessing is active?

An exception is raised if one tries to show a message box if the Dispatcher is suspended (Dispatcher.DisableProcessing() called). InvalidOperationException: 'Dispatcher processing has been suspended' (see here). Does anyone know how I can detect where the Dispatcher is suspended or not (so I know when to call BeginInvoke())? Edit 1: ...

Best Layout for showing multiple charts wpf C#

I have a strange problem that I want to show multiple graphs at run time and some times a single chart. Kindly suggest me a flexible layout because in future there will be more charts. currently im using grid im not sharing my code because it is all messy but I am showing you its layout that i achieved with grid layout. ...

Expand WPF Expander to bring contained element into view

I have an expander that has n contained elements (possibly other Expanders that also contain elements). Now I want to programmatically bring a contained element into view - like with BringIntoView() for ScrollViewers. All Expanders that currently hide the element should expand. My current idea is to subclass the Expander and make it ...

WPF Grid of Images - Best control to use?

I'm trying to convert my VB project to WPF, and one big problem I'm having is what to do about a large GridView that contains in each cell a single image. The grid needs to be very large so is the best way to do this in WPF a datagrid, or a dynamically generated Grid control, or something else? I'm not sure which controls give the best p...

How to set focus to a control in a TreeViewItem when selected.

I have a TreeView in which the items are defined by HierarchicalDataTemplates. Each TreeViewItem that is created has some TextBoxes in it. When a TreeViewItem is selected I want to set the Keyboard Focus to a TextBox of the TreeViewItem (the TextBox has the name 'TextBox1'). How can I do this? ...

How to serialize attached properties

Hello everyone, I am writing .NET3.5, WPF application using Composite Application Library. Application is divided into several modules. In infrastructure module I have defined NetworkNode object. The Network module manages a collection of NetworkNodes and uses XmlSerializer to store/load this collection. So far everythings works. But...

ViewModel tree vs. frequently updating Model tree

In my WPF MVVM application my model is a complex tree of Model objects wich constantly changes at runtime. Model instances come and go at runtime, change their position within the tree and of course change their many properties. My View is almost a one-to-one visual representation of that tree. Every Model instance is in 80% of the cases...

PreviewMouseRightButtonUp does not fire when Context Menu is open

If I right-click on an Image I get the following events (shown in order): 1) MouseRightButtonDown 2) PreviewMouseRightButtonUp 3) MouseRightButtonUp At this point my Application displays a context menu. If that is open, and I right click on the image again I only get this event: 1) MouseRightButtonDown Nor sure what to do to get t...

Disassembling WPF4 beta2 DLLs with Reflector

Hi there, I'm trying to disassemble some of the DLL of the new WPF4 Beta2 framework. However, all I have is empty methods for all types. I'm not having this problem for other DLL (for example mscorlib). Do you have any idea what is causing this behavior ? Is this anything to do with type forwarding (I know that some WPF types have mov...

WPF: How to stop the PriorityBinding's thread.

Listbox's ItemsSource is TList in XImage's Dispose method, How do I stop the thread which load the thumbnail? <ListBox.ItemTemplate> <DataTemplate> ... <Image.Source> <PriorityBinding> <Binding Path="Thumbnail" I...

List of Shapes to Database

I have a generic collection of shapes that I need to pass through WCF to store in a database for future/shared use. Unfortunately, the System.Windows.Shapes are all sealed, so I can't inherit them and make a serializable copy of them. I "could" write my own custom set of serializable shapes, as I have written 3 custom shapes for my app a...

how to handle mousedoublick click in better way?

Hi I have nested listview in wpf. user can double click the listitem and open the item document. so I have ListView1_MouseDoubleClick and child listview 2 ListView2_MouseDoubleClick but when user double click listview2 item , the listview1 also received mousedoubleclick event. so... inorder to fix this problem as far as I know there ...