wpf

Is there an equivalent of BitBlt in WPF?

Is there a way to invert a region of the screen using WPF? In Win32, I would do BitBlt ( .... DSTINVERT ...). Of course, I would use Interop but that seems pretty messy. ...

Need suggestions on an approach to take...

We have a solution with two different projects, one with the requirement that it be done using the .Net 2.0 framework. The other uses .Net 3.5, and we follow MVVM, though I suspect this is less about MVVM than good patterns. The .Net 2.0 has several different objects (let's say of type Fruit) which could potentially require a different ...

WPF - Confusion with namespaces and "odd" errors

I've been trying to get my head around XAML and it's namespaces and I just cannot seem to get the logics of things. For example, I'm trying to animate a gridrow's GridLength property following a tutorial. I can get the sample code to run just fine. But trying to actually port the features into my own code seems to be impossible. I always...

WPF, two-way binding to a hash table

Hi, I am binding to the values of a hash table from within a datatemplate and the values display fine, but the changes are not persisted to the object when I make changes in a text box for example. Any idea why this is? <DataTemplate x:Key="ResponseItemTemplate"> <StackPanel Orientation="Horizontal" > <TextBox Wi...

WPF: Bind DisplayMemberPath in a combobox to the Item

Ok, this is kind of odd but this is basically what I need to do. I have a WPF control that is bound to a Document object. The Document object has a Pages property. So in my ViewModel, I have a CurrentDocument property, and a CurrentPage property. Now, I have a combobox that I have bound to the CurrentDocument.Pages property and updates...

FlowDocumentReader Document doesn't get notified when bound source changes, why?

So I have this XAML in the .xaml file <StackPanel> <Button Width="200" Height="30" Content="Change Words" Click="Button_Click"/> <FlowDocumentReader ViewingMode="Scroll" Zoom="90" Focusable="True" Background="White" IsFindEnabled="True" IsPageV...

I feel like a rat in a pipe factory. Stratergy for designing WPF binding solutions?

So many dead ends! I'm trying to achieve two way binding between a visualization and an array of about 300 single bytes of data. It sounds simple but it turns out not. Even Bea Stollnitz, it seems, took three goes at binding a polyline to data: Part 1 Part 2 Part 3 What hope does a beginner have? So my question is: Is there a se...

Displaying a progress bar & text in a cell of a data grid (XAML)?

How can I display an animated progress bar within the contents of a cell of a datagrid, with text in the foreground. For instance, I want to display "Uploading..." and have the progress animated behind it. ...

Cancel BeginInvoke in WPF

In WPF, I am calling This.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, mydelegete); Is there a way to cancel later that BeginInvoke method? Thanks ...

fake a mousedown with left button in WPF

I have a control in WPF I want to fake a mousedown on that control, with left mouse button I am trying myControl.OnMouseDown(new MouseEventArgs(MouseButtons.Left, 1,0,0,0)) but it give me that "Cannot access protected method here" anybody have idea? Thanks ...

Where are examples of great program UI's built free with Winforms?

I'm trying to decide between Winforms and WPF for a C# application. I want a good free UI and I know WPF would make a great one. But how good can a free UI look built on Winforms? I've read that Paint.net was built on Winforms, but I don't think the UI is very attractive. I'm looking for the freshest looking free UI's that can be b...

How can I set the minimum size of a expander control in WPF ?

How can I set expander to show some content it encloses even in collapsed state ? I have the following code snippet, can anyone point changes to this code ? <Window x:Class="UI2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="358" W...

How to achieve databinding with an user control in wpf?

Hi! I'm fairly new to WPF and I have some problems getting databinding to work as I want. I've written a user control which contains a TextBox whose Text-Property I want to bind to a property of my UserControl, which I want to bind again to something else. What am I missing? XAML <!-- User Control --> <TextBox Text="{Binding Path=The...

Automatic vertical scroll bar in WPF TextBlock?

Hi, I have a TextBlock in WPF. I write many lines to it, far exceeding its vertical height. I expected a vertical scroll bar to appear automatically when that happens, but it didn't. I tried to look for a scroll bar property in the Properties pane, but could not find one. How can I a vertical scroll bar created automatically for my Tex...

Howto RadioButtons and MVVM pattern

I'm using PRISM (and thus the MVVM pattern). I've got a complex DateTime picker view with radio buttons. The user can pick today, yesterday, a date, a week of a year, etc. I use radio buttons for the different choices. What's the best way to do that in MVVM? I really can't think of a clean way. I could create lots of custom behaviors ...

How to force binding evaluation every time a ContextMenu is opened ?

I have a ContextMenu with a MenuItem in it: <Grid> <Button Content="{Binding Test}"> <Button.ContextMenu> <ContextMenu> <StackPanel> <MenuItem Header="{Binding Test}"/> </StackPanel> </ContextMenu> </Button.ContextMenu> </Button> </Grid> ...

WPF Combobox validation

Hi. I have a ComboBox with Sex(male, female..):And I demand from user to select a value (the ComboBox has no value by default.) <ComboBox ItemsSource="{x:Static Member=data:Sex.AllTypes}" SelectedItem="{Binding Path=Sex.Value, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" VerticalAlignm...

Courseware project using WPF

I like seeing some e-courseware to learn some knowledge. Now I start to learn WPF. I wish I could develop a courseware project using WPF later. Does anyone can provide me some WPF projects about courseware development? These can either be applications written entirely for showcasing WPF features, or real-world applications written in WPF...

Getting Entity Framework to update both normal and relational fields

Hello, I have a problem figuring out the proper way to get foreign key fields to update using the Entity Framework. I do not have a problem updating them in the database, but rather on the interface. Here are the relevant tables to my question file:///C:/Users/Mike/Desktop/RelevantTables.bmp I have a "Team" form with a Master/Detail ...

WPF, two-way binding to a hash table doesn't update the source object

Hi, I am wondering if anyone can help, I am able to bind to a hash table and display values correctly, yet the two-way binding I have specified doesn't update the object when I make changes. <DataTemplate x:Key="ResponseItemTemplate"> <StackPanel Orientation="Horizontal" > <TextBox Width="200" Text="{Binding Path=...