wpf

Dynamic DataGrid columns in WPF DataGrid based on the underlying set of data (and their type)

Hello everyone, I've got kind of a conceptual question. I am in the process of wrapping some statistics classes I wrote into WPF. For that I have two DataGrid(-Views, currently in WinForms). In one DataGrid each row represents a column in the other. There I can set-up different variables (as in mathematical/statistical variables) with...

WPF Application hosting a HTML page, the flash is disabled, how to enable?

Hi, I have made a small application where the user can browse to a web page, im using a "Frame" for the purpose and passes a URL to it, it then renders the destination page as HTMl. The page im trying to show shows some flash animation and my "Frame" browser cant show it, i suspect that the browser plugin is disabled, but how to enable, ...

Validating collection elements in WPF

I would like to know how people are going about validating collections in WPF. Lets say for example that I have an observable collection of ViewModels that I am binding to the items source of a grid, and the user can add new rows to the grid and needs to fill them. First of all I need to validate on each row to ensure that required fiel...

Stretch empty WPF ListView to take the remaining space

I always have problems with a ListView inside a dynamic layout control like a Stackpanel. Right now I have a Window with a Stackpanel as Root-Control. The Stackpanel streches perfectly and takes the complete window. Inside the StackPanel are some other controls like textboxes and button all aligned fine. The last Object is a ListView. ...

Application.Current.Shutdown() vs. Application.Current.Dispatcher.BeginInvokeShutdown()

First a bit of background: I have a WPF application, which is a GUI-front-end to a legacy Win32-application. The legacy app runs as DLL in a separate thread. The commands the user chooses in the UI are invoked on that "legacy thread". If the "legacy thread" finishes, the GUI-front-end cannot do anything useful anymore, so I need to shut...

How can add toolbar in toolbarpanel programatically?

Hi all, I want to add my toolbar inside the toolbarpanel in codebehind. I saw one example of button & canvas panel. Here is the code: Canvas.SetLeft(newButton, containerPoint.X - objectPoint.X); Canvas.SetTop(newButton, containerPoint.Y - objectPoint.Y); how can i achive samething with toolbar & toolbarpanel instead of using canvas...

WPF - 'Relational' Data in XAML Using DataContext

Hi, Say I have a list of Employee IDs from one data source and a separate data source with a list of Employees, with their ID, Surname, FirstName, etc. Is it possible in XAML only to get the Employee's name from the second data source and display it next to the ID, using something like this (with the syntax corrected)?.. <TextBlock x:...

Why does nothing in WPF have a click event?

This seems very strange to me. I know through some adventurous inheritance you can convert most UIElements to a button, but it is a cumbersome way of implementing the most basic of of computer events ...

How to hide the border around child window

Hi, I have a child Window , and I am displaying it from the code behind as below: ChildPhotoViewer PhotoViewer = new ChildPhotoViewer(); PhotoViewer.DataContext = selectedPhoto; PhotoViewer.Title = selectedPhoto.strTitle.ToString(); PhotoViewer.Show(); But While Displaying the child win...

Splitting up/merging windows in WPF

I'm new to WPF but I need to implement following functionality: I have a window that contains one Grid (might be changed to stack panel or something else). In that Grid I have 2 columns, each of them contains another Grid. Lets call them gridFirst and gridSecond. There is also GridSplitter in first column allowing to resize the columns....

xamlparser error after clickonce deployment.Application crashing after installation

Hello Good People, I've built an WPF application with visual studio 2008 and created an installer for it.Works fine so far.I realized it lacks the automatic updates feature, and after trying several solutions, i decided to give a try to clickonce deployment.After a successful deployment on a network server, i 've noticed that the applica...

MVVM with animations (should I use VisualStateManager?)

I've got a View.xaml with the following set in Resources-section: <DataTemplate DataType="{x:Type ViewModels:MyFirstViewModel}"> <Views:MyFirstView Content="{Binding}" /> </DataTemplate> <DataTemplate DataType="{x:Type ViewModels:MySecondViewModel}"> <Views:MySecondView Content="{Binding}"/> </DataTemplate> In the content of ...

Label Size is always NaN ?

Hi, I have a Panel which I want to extend and override MeassureOverride and Arrange to have my custom layout. Basically, the panel will contain some labels. As the label has some text content, it should have a specific size. However when I use label.ActualHeight or actualwidth, desiredSize ... in the MeassureOverride or ArrangeOverride...

WPF DataBinding to standard CLR properties in code-behind

Hi everyone, Just learning WPF databinding and have a gap in my understanding. I've seen a few similar questions on StackOverflow, but I'm still struggling in determining what I have done wrong. I have a simple Person class with a Firstname and Surname property (standard CLR properties). I also have a standard CLR property on my Window ...

Wrong selection in ListBox with VirtualizationMode="Recycling" and SeclectionMode="Extended"?

I have a really strage behaviour. I have a ListBox in the View with a DataTemplate for its items including ViewModels. I bind the IsSelected to my ViewModel and use SelectionMode="Extended". Everything works fine. BUT if I add VirtualiuationMode="Recycling" the I get the wrong items. To reproduce: select items with Ctrl, then scroll down...

Can't cast treeviewitem as treeviewitem in wpf

Hi, I've got webservice asmx, and there are classes: Country public string Name {get;set;} public string Code {get;set;} public List<Area> Areas {get;set;} Area public string Name {get;set;} public string Code {get;set;} public List<Regions> Provinces {get;set;} Provinces public string Name {get;set;} public string Code {get;set;}...

Unable to launch onscreen keyboard (osk.exe) from a 32-bit process on Win7 x64

90% of the time I am unable to launch osk.exe from a 32bit process on Win7 x64. Originally the code was just using: Process.Launch("osk.exe"); Which won't work on x64 because of the directory virtualization. Not a problem I thought, I'll just disable virtualization, launch the app, and enable it again, which I thought was the correct ...

How do I capture WPF animation and export it as animated GIF?

Given that I have a WPF Canvas and 10 seconds. I want to capture frames in that time period and export it as an animated gif. How do I do that? Functional examples please, thank you! ...

wpf 4.0 datagrid template column two-way binding problem

Hello all! I'm using the datagrid from wpf 4.0. This has a TemplateColumn containing a checkbox. The IsChecked property of the checkbox is set via binding. The problem is that even if I specify the binding mode explicitly to be TwoWay, it works only in one direction. I have to mention that the same code works perfectly in .net 3.5 wi...

wpf converter in xaml

Hi, I know there are a few ways to use value converter in xaml, like using StaticResource to get converter from resources or Static to get from a static instance. My question is, for whatever reason, I have a converter instance created in the code behind, and can be accessed through a non static property, How can I use this instance of ...