wpf

How to animate CornerRadius property with four distinct values - "0,0,0,0" to "0,0,10,10" ?

Hi all I have to transition the CornerRadius property of a Border from value "0,0,0,0" to value "0,0,10,10" via an animation. This must be done directly in the XAML file w/o using code behind other than a ValueConverter or similar. I think CornerRadius is animatable using an ObjectAnimationUsingKeyFrames - but how to animate just two o...

Strategy for unsubscribing event handlers

In my WPF application I have a View that is given a ViewModel, and when given this View it adds event handlers to the ViewModel's PropertyChanged event. When some action occur in the GUI I remove the View and add another View to the holding container - where this new one is bound to the same ViewModel. After this has happened the old V...

Problem with empty line in FlowDocument with Figure in WPF

I put this content as Document in FlowDocumentReader. FlowDocument flDoc = new FlowDocument(); flDoc.ColumnGap = 10; flDoc.ColumnWidth = 130; flDoc.TextAlignment = TextAlignment.Justify; flDoc.IsOptimalParagraphEnabled = true; flDoc.IsHyphenationEnabled = true; flDoc.IsColumnWidthFlexible = true; Paragraph par = new Paragraph(); par....

To show the help related information in WPF.

I have several dialogs in the application. I want to pop up help related box when user clicks on the help button next to Main Heading. The help box is activated by selecting the small blue icon next to the heading. When the help box appears it has the information that is required to understand the entry related to the dialog. This hel...

Stopping multiple animations in WPF

I am running multiple animations within a story board, I want to be able to stop them all but I have not had much luck. I have tried: pathAnimationStoryboard.Stop(); pathAnimationStoryboard.FillBehavior = FillBehavior.Stop; …and a few others to try and control this. Can anyone point me in the right direction. I’m pasting the code to ...

some troubles with WPF and Windows XP

is .net framework 3 compatible with xp? i install visual studio 9.0 (.net 3.5) on win XP. when i compile a WPF project and try to run it, this error occurs: cannot initialize application ...... at address 0x<some digits> (antivirus protection is off) after first fail of wpf, all other project types (windows application, console &...)...

WPF: Viewbox and TranslatePoint

Hello, I have a Viewbox with a Canvas Child, I have the Stretch property of Viewbox to Fill, I have changed the width and height of the Viewbox, I need to get the location of children in Canvas with respect to Viewbox parent I tried : Point p = viewboxInstance.TranslatePoint(new Point(Canvas.GetLeft(child), Canvas.GetTop(child)), vie...

How do I use a code behind property in a trigger to change a control property?

Hi, I am trying to do a fairly simple thing in my WPF application, or at least I think it's simple. I have a Window that contains an int property in the code behind. Let's call this one IntProperty. The Window implements the INotifyPropertyChanged interface and IntProperty fires the notification on change. It looks like this: ...

Evenly distibuted scatterViewItems that dont overlap

Hi I have an app that creates a variable number of ScatterviewItems based on which tagged object is placed on the surface table. The ScatterViewItems are added programatically to the ScatterView based on info looked up in a DB The Scatterview does a good job of displaying this info However, I would like them to be evenly distribut...

How to make ListView change ItemControl to VirtualizingStackPanel at runtime

OK, so, I have a ListView-derived control that changes Grouping and ItemsSource on the fly. When I group such that the scrollbars dissapear, and then change my ItemsSource to a different ICollectionView, my scrollbars do not return. The basic problem is that ListView changes to a VirtualizedStackPanel when grouping is activated and d...

WPF: Hide grid row

Hi All, I have a simple WPF form with a <Grid> declared on the Form. In this Grid I then have a bunch of Rows: <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="30" /> <RowDefinition Height="Auto" Name="rowToHide"/> <RowDefinition Height="Auto" MinHeight="30" /> </Grid.RowDefinitions> So ...

WPF Binding Syntax Question

I've seen this syntax show up, and have tried to google for it's definition to no avail; what does it mean when a dp is bound this way? <Grid> <ContentControl Content="{Binding}"/> </Grid> I was under the assumption that you have to bind to some property on the DataContext, or another element, but this appears to bind to nothing. ...

Trouble displaying an object in WPF

I'm so new to this that I can't even phrase the question right... Anyway, I'm trying to do something very simple and have been unable to figure it out. I have the following class: public class Day : Control, INotifyPropertyChanged { public static readonly DependencyProperty DateProperty = DependencyProperty.Register("Date"...

How do you place controls on the chrome of a WPF Window when the user is on Windows XP?

How can you place controls on a frame of a WPF window? I took a look at this but I don't know how to do this in WPF. link textThe problem comes when The application has to run on Windows XP where there is no DWM support. Also, if this is running on Vista without DWM, could the article still work? ...

WPF DataGrid: Make cells readonly

I use the following DataGrid <DataGrid Grid.Row="1" Grid.Column="1" Name="Grid" ItemsSource="{Binding}" AutoGenerateColumns="False" > <DataGrid.Columns> <DataGridTextColumn Header="Name" Width="100" Binding="{Binding Path=Name}"></DataGridTextColumn> <DataGridTextColumn Header="OldValue" Widt...

Visual Studio compiles WPF application twice during build

I have a WPF app in VS2008 that compiles twice during the build. The two CSC command lines are similar but with some differences. The first CSC command line does not have an /resource options, the second has two /resource options on the command line. The second CSC command line has these additional arguments: /resource:"obj\Debug Aut...

WPF image cropping

I'm loading layers of images to make a single image. I'm currently stacking them all onto a canvas. I've got it set up so the user can specify the final dimensions of the single image, but even when I change the size of the canvas the images retain their original sizes. I tried to modify the image size as I was loading them in, but th...

Access properties controls of a window from a page in WPF

Hi, My problem is that I want to access from a page to the properties of a control (button, textblock, label, or a menuitem of the window....) placed in a window. The page is placed into the window. How can I do this? Is there any method to find controls by name in a specific window or page or entire application? Thanks. ...

Free WPF Flow charting Component

I am looking for a WPF Flow charting component. Something that will let you draw boxes and display lines between them based on some object structure/collection. Anyone know about anything like that out there? I prefer free as this is an open source project I plan to put it in. ...

TreeView binding issue in WPF

Consider the following data structure: List<Person> People; class Person { List<Car> Cars; List<Hobby> Hobbies; } I want to bind a TreeView to this structure. And it should look like this: People > Frank > Cars > BMW > Ford > Hobbies > Tennis > Golf > Jane > Cars > Hobbies How can this be achieved in X...