wpf

Host a WPF control in activex instead of Win32 App

I'm searching an example of an activex that contain a WPF control. I'm able to see the control during registration of activex in the test activex container but when I instantiate it i cannot see WPF but what is coded inside OnDraw. Any hint or example? ...

WPF UC in Winforms occasionally has an odd border to the left / visually corrupted

I have a WPF user control I created that is used to show the state of tasks in my UI. I get the odd report back that the control sometimes has a nasty looking border to the left and I cannot reproduce it. The control looks like this (when working) (grey tick=not run, green=OK,red cross=fail,hourglass=running); It looks like this when...

Why do I have an Issue with binding to an image from a control template?

Hi, I have a style for an items control that binds to an image in the target, it only appears if the target also binds to the image and I have no idea why.. can anyone shed any light on it for me? A simplified version of my style: <Style x:Key="testStyle" TargetType="ItemsControl"> <Setter Property="Control.Template"> <Se...

Property "Pages" does not contain support for type PageContentCollection

I get the following error on the second line of the code below: The error is: Property "Pages" does not contain support for type PageContentCollection. Here is my complete code: <FixedDocument Name="customerReport"> <PageContent> <FixedPage> <Label FontSize="20" Margin="100,20,0,0">REPORT</Label> ...

WPF: How to combine animations with custom event handling?

I'm trying to create a custom WPF control that is draggable, but also animates as it is dragged. I need to override OnMouseDown to implement the dragging functionality, but I also want my animation triggered on the MouseDown event. Without dragging functionality--i.e., when OnMouseDown is not overriden--the animation works, but when I o...

Are there any FlowDocument diff viewers for WPF?

We have 2 flowdocuments that we'd like to compare similar to when using a diff viewer (winmerge, beyond compare, etc). Has anybody done this or know how to get the text out of a flowdocument to do a compare? ...

In WPF, how do I make my controls inside a usercontrol private?

I have a user control with a ComboBox and a TextBox. Everything is working great except I noticed that from my user control's instance object, I can access those two controls. They shouldn't be accessible except via my own exposed properties. ...

C# WPF resolution independancy?

Hello, I am developing a map control in WPF with C#. I am using a canvas control e.g. 400 x 200 which is assigned a map area of e.g. 2,000m x 1,000m. The scale of the map would be: canvas_size_in_meters / real_size_in_meters. I want to find the canvas_size_in_meters. The canvas.ActualWidth gives the Width in DIU's (Device Independan...

Change font increment for WPF RichTextBox

I'm using a WPF RichTextBox control to input some text with user formatting capability, including font size adjustment. The built-in commands for IncreaseFontSize and DecreaseFontSize will adjust the font size by 0.75pt each time the command is executed. I would like to increase the granularity to 2pt. Can this be done without impleme...

How do I conditionally change properties of controls in the CellTemplate of a data bound WPF ListView?

Ok... I'm new to WPF, but I kind of know how to do things using DataTriggers and Converters. But, what I want to seems a little more complex than that. Let me give you the details: The DataContext for the ListView control is an IList of objects (object=Room). These are the available rooms. I've got another control (let's say it's a ...

Replacing numbers with hashes in WPF when the text is too large

I'm looking for a simple, idiomatic method of replicating Excel's visual cue that a number is too large to be displayed in a column. I've got the following xaml: <ListView.View> <GridView> <GridViewColumn ... /> </GridView> <ListView.View> and what I'd like is if the text in the column is too small to be displayed (i.e...

Using Listbox in ItemTemplate

Hi, I have a listbox control. I have created a ItemTemplate for this listbox which has two controls within it. Toggle Button Listbox Control Structure Basically the Listbox2 is a CheckedListbox. My requirement is as follows 1. Bind the ToggleButton to Listbox1 SelectedItem.i.e if 4 item is selected ...

Best way to change ListBox selection to be a toggle selection

I have a ListBox control that I want to change into having a toggle selection. i.e. Click once on an item selects it, click again it deselects it. Also, clicking another item in the list should do the default action of deselecting the previous item and selecting the new one. What's the best way of achieving this? ...

How can I simulate additional mice in Windows?

I'm using the MultiPoint SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom. Because we need to support up to 40 mice connected to one computer, we need an automated way to test our software. The SDK will support as many mice th...

WPF DataContext Binding and Refresh

My scenario is: I have a WPF Window with 3 data-bound text boxes SettingsUI : Window <Grid Name="SettingsUIGrid1"> <TextBox Text="{Binding Path =val1}" .... <TextBox Text="{Binding Path =val2}" .... <TextBox Text="{Binding Path =val3}" .... </Grid> In the constructor I do this: SettingsUIGrid1.DataContext = coll[0]; // collection f...

Remote Debugging for .NET WPF Application via Visual Studio 2008 Remote Debugger ?

Remote Debugging for .NET WPF Application via Visual Studio 2008 Remote Debugger can this be done ? I see native only in the options ? Any help please... ...

WPF - How can I selectively set the "Visibility" of a TabItem via DataBinding/Triggers

I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I WANT to do: <TabItem Header="Blah"> <TabItem.Triggers> <DataTrigger Binding="{Binding BlahType}" Value="0"> <Setter Property="TabItem.Visibility" Value="Hidden" /> </DataTrigger> </TabItem.Triggers> ...

Pattern for null settings

Hi, I would like to hear your thoughts and ideas about this one. in my application i have controls that are binded to objects properties. but.. the controls always looks like that: a check box, label that explain the settings and then the edited control (for ex: text box) when unchecking the checkbox i disable the text box (using bind...

WPF User Control Parent

I have a user control that I load into a main window at runtime. I cannot get a handle on the containing window from the user control. I have tried this.Parent, but it's always null. Does anyone know how to get a handle to the containing window from a user control in WPF? Here is how the control is loaded: private void XMLLogViewer_M...

M-V-VM Design Question. Calling View from ViewModel

I've just started looking into M-V-VM for a WPF application. Everything makes sense so far besides this particular issue... I have a ViewModel I'll call Search. This ViewModel binds to a datagrid and lists results of items. Now, I have a command that needs to bring up another view, the item's details. Putting the logic to show anoth...