wpf

WPF Colors - Accessibility considerations?

Many of the WPF examples and samples that I see seem to have hard-coded colors. These guidelines - http://msdn.microsoft.com/en-us/library/aa350483.aspx suggest not hard coding colors. After building a small application I was disappointed to see that some of my hard-coded color choices made some sections of the application unusable when ...

Can a fixed document can be split into multiple fixed documents in WPF?

Hi, There is a context sensitive help.Which depends on the present screen. So for example, can a one document consisting of 10 pages when shoum in a documentviewer, can i constraint that document to show only 3rd and 4th page. and any search should be constrained to these pages. Please help. Thanks, ...

stop current thread until input is received from another window wpf C#

I want to stop other Threads until user input in this window... giving code that i have yet if (!File.Exists(@"DiscoveryConfig.bin")) { Application.Current.Dispatcher.Invoke((showRangeInputWindow)delegate() { new WinSubnetRangeInput().Show(); }, null); } Lets say th...

WPF Canvas and Grid overlay

I have a grid which represents some data, and i need a canvas to overlay on top of it to layout some lines. The canvas is inside it's own usercontrol The problem is that the canvas and it's contents should autoresize when the grid resizes width and height. I added the canvas inside a viewbox, but it didn't do the trick. When the grid...

WPF - Databind dynamic control type

Hi, I have a Person class. A Person can have an associated control. Can I display the control through data binding? e.g: Name: Bill , Control: TextBox Name: Bob, Control: ComboBox Name: Dan, Control: CheckBox I have the following xaml in my resource dictionary <DataTemplate x:Key="PersonTemplate"> <DockPanel > ...

Given a styled WPF DependencyObject, how can I get the Style Key in code?

I have a set of controls bound to data, on which I would like to programmaticaly add validators to the bindings. Currently I'm able to iterate over the visual tree to find those controls with bindings, and also add my validators to these controls. But to further specify which controls should have specific validation I wanted to use style...

Can multiple xps documents be merged to one in WPF?

Hi, Can multiple xps documents be merged to one xps document in WPF and shown in DocumentViewer? An application has 4 small xps documents each displayed seperately, but in one of the places all 4 documents should be shown as one document. How to go about it? Thanks, Ershad ...

Microsoft WPF ribbon - how can I add a RibbonTab stored in a Resources.xaml file?

I have a RibbonTab defined in a Resource file (xaml resources) and i need to add it to the ribbon's tabs collection. How do i do that? (In xaml) The Ribbon in xaml is something like that: <Ribbon> <Ribbon.Tabs><Ribbon.Tabs/> </Ribbon> So it holds a collection of tabs, i don't know how to insert a tab stored in the static resour...

WPF and canvas overlay

I have a grid which represents some data, and i need a canvas to overlay on top of it to layout some lines. The canvas is inside it's own usercontrol The problem is that the canvas and it's contents should autoresize when the grid resizes width and height. I added the canvas inside a viewbox, but it didn't do the trick. When the grid r...

wpf propertyGrid

Hi all, I need a propertyGrid for my WPF application . after lots of searches I have found this I have added the assembly (exe file) when I add the propertyGrid to my form and I run it I can't see it in the form . xaml code : <Window x:Class="propertyGridTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...

Silverlight Error: AG_E_UNKNOWN_ERROR

Hi I'm getting a AG_E_UNKNOWN_ERROR when running my Silverlight project. The project is ported from WPF, and from what I can gather around the web, I'd assume it's related to something invalid in my XAML EDIT C# Control sources can be found here: SilverlightCalendar/Controls Here's Generic.xaml, the styles for my application. <Resou...

Deleting a window's background image WPF

I'm having a problem in WPF where a window doesn't release it's file-lock on the background image file after closing, before another part of the application tries to write to the image. So as an example; say I have a WPF app consisting of 3 windows, 1 "menu" selection window and 2 others. Both of the windows create an ImageBrush using a...

How to have classes of DataTemplates?

In my application, I would like to have DataTemplates such that I can say: These are the DataTemplates for use in a TreeView These are the DataTemplates to use when showing the summary of an object These are the DataTemplates to use when showing details The only way I've seen to be able to do this is to create a DataTemplateSelector ...

Printing a WPF BitmapImage

What's the best way to print a BitmapImage? I come from a background in System.Drawing so I was thinking about converting it to a Bitmap and then printing it, but I'm thinking there's probably a better way. Thanks! ...

WPF - Scrolling Listbox in an Expander

I have an Expander that I want to have a ListBox in. When the I open the expander the ListBox just expands off the screen (rather than expanding to fill what is available and then scrolling) Here is my XAML: <DockPanel Margin="266.25,0,455,12" Name="dockPanel1"> <StackPanel> <Expander Header="expander1" Name="expander1" Wi...

How to get WPF window controls collection

Hello, I try to get all WPF window controls collections. In other words i try to get the same result, as it was in win forms app's: form.Controls I want to use values of these controlls when i format an SQL query. It's possible to get such control collection of WPF window? Thanks ...

Create Alt-key shortcuts in WPF/XAML

I have a XAML window with multiple TextBoxes, each with a corresponding TextBlock tag for a title. I would like to enable alt-key shortcuts for this window (hold down the alt key to show underlined letters in the TextBlock titles, type one of those letters and focus should change to the corresponding TextBox). I've found out how to do ...

WPF - Linq moved to constructor is causing null reference exception, how come?

Having been given the all clear to move code from my Page_Loaded method to the constructor (See HERE), i am now encountering errors on my Linq to entities query. It is now causing a nullreferenceexception and i can't figure out why at the moment. See below for the exception location. public Building() { InitializeComponent(); l...

What happened to the prism project linker in Visual Studio 2010?

How do I share files between WPF and Silverlight projects in Visual Studio 2010? ...

Good examples of MVVM Template

I am currently working with the Microsoft MVVM template and find the lack of detailed examples frustrating. The included ContactBook example shows very little Command handling and the only other example I've found is from an MSDN Magazine article where the concepts are similar but uses a slightly different approach and still lack in any...