wpf

How to programmatically start a WPF application from a unit test?

Problem VS2010 and TFS2010 support creating so-called Coded UI Tests. All the demos I have found, start with the WPF application already running in the background when the Coded UI Test begins or the EXE is started using the absolute path to it. I, however, would like to start my WPF application under test from the unit test code. That...

Multiple ListBoxes binding their SelectedItem to the same property in ViewModel - better way?

I have a WPF listview, and in one column the cell may contain one or more ListBoxes. When I right-click a ListBox I'm building a context menu where each item has a DelegateCommand. Currently I'm setting the command parameter to a SelectedListBox property on the page viewmodel itself as my delegate command needs to know which ListBox has...

In WPF how to create a textblock with copy text option (OR) a text box with text trimming option

In WPF how to create a textblock with copy text option (OR) a text box with text trimming option. Any control template needed? If yes, please let us know hpw to build it. Please help. Sukan ...

WPF Menu Open direction

I have the following menu. <Menu> <MenuItem Header="Menu1"> <MenuItem Header="Sub1"/> <MenuItem Header="Sub2"/> <MenuItem Header="Sub3"/> <MenuItem Header="Sub4"/> </MenuItem> <MenuItem Header="Menu2" /> </Menu> The sub-menu when opened is ...

[WPF] FileNotFoundException sometimes when launching application

Hi all, for automatic update of my WPF application, I've this strategy : (1) process.exe starts process.exe looks for update => there's an update process.exe makes a copy of itself => process_copy.exe process.exe launch process_copy.exe with "update" parameters process.exe exits (2) process_copy.exe starts process_copy.exe see the "up...

Stumped - bubbling an routedevent up to top window in WPF - how to capture anywhere!

The literature is awful in this regard - all I want to do is bubble an event up from a control that I have defined but created on the fly (hopefully this will not cause issues) from a broker controller class. The control is a PopUp. public static readonly RoutedEvent weClosed = EventManager.RegisterRoutedEvent("TIMBOO", RoutingStrategy...

highlight the rowHeader and ColumnHeader for a selected cell wpf DataGrid

Hi. I am in the process of creating a excel like theme using the WPF Toolkit DataGrid, Im at a dead end and was wondering if someone has dealt with this problem: In my grid i need to highlight the rowHeader and ColumnHeader for a selected cell but can’t seem to get how. I am looking for this functionality: http://i738.photobucket.com/a...

Flash colour when value in ListView cell changes

I have a ListView (shown below). I would like the cells to flash a colour when the value displayed changes (ideally one colour for increases, one for decreases). I know how to write the animation for the colour (below), and I'm pretty sure I need to use a cell template so I can hook a trigger up to the style to start the animation. I'm ...

Is it possible for a PDF produced by a component to match the line wrapping of a WPF TextBlock exactly?

We have a WPF application that has a print preview dialog. When we create the PDF to match this print preview dialog, we want the PDF to show a 100% match. For instance, we have a WPF TextBlock with a set height and width and some content that wraps in the text block. We then want to recreate this text exactly in the PDF. So far we h...

WPF Dynamically Setting CellTemplate and Binding

I have a GridView control and I am adding GridViewColumns. I was using DisplayMemberBinding property of GridViewColumn but now I want to use the CellTemplate. I am binding to a dictionary. The following code worked with DisplayMemberBinding: var column = new GridViewColumn { ...

How can I stretch bitmap in WPF without smoothing pixels

Hi, I'm working on SEM image processing application, written in WPF. I have an image display control, derived from Canvas, which displays image & overlays using DrawingVisuals (one for each "layer"). It also implements Zoom & Pan using scale & translate transform, applied on DrawingVisuals. When I zoom in the image to see individual pi...

WPF: Focus in a Window and UserControl

I'm trying to get a UserControl to tab properly and am baffled. The logical tree looks like this. |-Window -Grid -TabControl -TabItem -StackPanel -MyUserControl |-StackPanel -GroupBox -Grid -ComboBox -Textbox1 ...

switching wpf resource dictionaries at runtime

Hi all, I am trying to build a wpf application that allows the user to change the theme at runtime. What I have done so far is create a resourcedictionary with all the colors for the application defined in it and then I am binding to this dictionary in the xaml. Below is the code I have for switching the resource dictionary: if (Syst...

Changing DataTemplate TextBlock Property at Runtime

I have a DataTemplate defined as follows: I am accessing it at runtime using the code below: else { template = (DataTemplate)FindResource("GridViewTextBlockDataTemplate"); var textblock = (TextBlock) template.LoadContent(); textblock.Text =...

WPF dynamic data architecture

So I'm having some level of difficulty with architecting a particular solution with some dynamic data elements.... So I've got two places where I'm storing data -- a database and a pdf (although I only write to the pdf - I never read from it). You can think of the pdf working a lot like a database -- except that the schemas for the tab...

Foreground of Button not changing in property trigger

Why does this trigger work (Changing the foreground of the button to "Red" when the mouse is over) <Grid> <Grid.Resources> <Style TargetType="{x:Type Button}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Red"/> </Trigger> </Style.Triggers> </Style> </Grid.R...

WPF Architecture & Creating Unique Builds

I haven't figured out the correct programming architecture for: -WPF Application -Each build will be unique for each customer -There will be unique variables for each customer in both code and the app.config file -Ideally, there will also be unique deployment URLs for each customer What is the best way to build the project file given th...

Is it possible to supply a type converter for a static resource in WPF?

I have a newbie WPF question. Imagine my user control has a namespace declaration like this: xmlns:system="clr-namespace:System;assembly=mscorlib" And I have resources for the user control like this: <UserControl.Resources> <system:Int32 x:Key="Today">32</system:Int32> </UserControl.Resources> And then somewhere in my user cont...

Can I shake a users desktop using WPF?

I'm writing an application for personal use that will track how often I reach for the mouse, and will keep a counter of how long I've gone mouseless. When I use the mouse, I would like it to shake my desktop workspace for a second as a negative reinforcement action. The application is going to be called WristSlap and will be on github a...

WPF: Launch ModalDialog control from within XAML ?

Hello, I'm building WPF client application. I'm following MVC pattern. The project solution has many items, so I created „Views“ and „Controllers“ separate assemblies. „Views“ assembly references „Controllers“. Problem: I need to load ShowModalDialog user control from withing controller instance which has no reference to View d...