wpf

Ellipse geometry bound points

Hi Is there a automatic way to get all the points of an ellipse stroke, without the filling points. Thanks in advanced ...

C# WPF Converting english numbers to arabic numbers.

I need to display an english double in arabic numerical characters for an application I am working on. Here is an example class that holds the double: public class Class1 { private double someDouble = 0.874; public double SomeDouble { get { return someDouble; } } } I want to convert the value of SomeDouble to...

Combobox with a ListView as DataTemplate (WPF)

Hi, I have a combobox which should have a datatemplate to hold several columns (along with its headers). I have created a simple DataTemplate, but I can't seem to display a ListView in it. All I can do is have the DataTemplate hold a StackPanel which then binds to my individual rows. But this way I cannot add Headers to each 'column...

How can I use the Dispatcher.Invoke in WPF? Change controls from non-main thread

I have recently started programming in WPF and bumped into the following problem. I don't understand how to use the Dispatcher.Invoke method. I have experience in threading and I have made a few simpele Windows Forms programs where I just used the Control.CheckForIllegalCrossThreadCalls = false; Yes I know that is pretty lame but thes...

Why does OnPropertyChanged not work in Code Behind?

I'm trying to simplify some code by putting the ViewModel models into the code behind and binding the DataContext as "this", but it seems to work differently, in the following example: Why is it when the button is clicked, the TextBlock bound to "Message" does not change, even though OnPropertyChanged("Message") is called? XAML: <Wind...

WPF Resource Management

I am writing a program that has to access images from a legacy data file format. (To be specific: The program is loading it's UI images directly from the data files of an old game) Since the images are all stored as Targa (TGA) files, I have to preprocess them into PNG files. I do that in a local application data folder. My problem is w...

Why MVVM and what are it's core benefits?

Why we go for MVVM over MVC or MVP while dealing with WPF? What extra benefit we get by using this? Edit: To be honest , today I had an interview and I have been asked this question. I answered like INotifyPropertyChanged , ICommand,IValue Convertor.. but he was not satisfied. Henceforth I have put up this question Thanks in advance...

How can you "plug into" the WPF rendercycle to get accurate results from VisualTreeHelper?

I am currently writing a WPF User control (PARENT) which can contain multiple child (CHILD) user controls. I am connecting the (CHILD) controls with polylines. To do this I need the locations of the CHILD user controls. However, the locations i get from VisualTreeHelper.GetOffset are zero. WPF is probably not finished yet with sizing an...

Programmatically change selected ListBoxItem

Is it possible to change the selected ListBoxItem from Code-Behind in Windows Presentation Foundation? It's a quite simple task really, I have a Next and Previous button and they represent the next and previous item in the ListBox. But, myListBox.items are of course object represntations of what i stored in the ListBox. So, how would o...

RTF with Links in a RichTextBox WPF

Hello all, I am able to load an rtf document in a RichTextBox, but the links that the document contains to some websites are not working. Anyone have any idea why? Some solution to make the links work? Best regards, Paulo Azevedo ...

Prevent UI from freezing without additional threads

What solutions do I have if I want to prevent the UI from freezing while I deserialize a large number of UI elements in WPF? I'm getting errors complainig that the objects belong on the UI Thread when I'm trying to load them in another thread. So, what options do I have to prevent the Vista "Program not responding" error while I'm loadin...

Using Base classes in WPF

Hello. I have problem with base classes in WPF. I try to make a base class with some base elements, so that other windows can inherit these components. But all that i have, when I inherit base class is only empty window, without these elements. For better understanding i put my code here: using XSoftArt.WPFengine; namespace XSoftArt { ...

Why does my customized WPF RadioButton not look right?

I am replacing the style of a radio button with that of a check box. I know you are going to say that is a bad idea, but it really needs to work this way. Anyway, using Expression Blend I was able to extract the style of the CheckBox and apply it to a RadioButton. My only problem is now that when it draws there is no border. Can anyo...

How to use Itunes-like functionality of windows-7 with WPF? (thumbnail toolbar)

How to use such functionality of windows-7 with WPF (one that uses Itunes - see the Prt Scrn below)? ...

How can I programmatically generate keypress events in C#?

How can I programmatically create an event that would simulate a key being pressed on the keyboard? ...

WPF Datagrid sort on column with null elements.

Hi, I have a WPF Datagrid that I am using with a number of columns. One of the columns has some elements that are sometimes null and this causes an exception when I try and sort on this column. The definitions of the columns is something like: <dg:DataGrid.Columns> <dg:DataGridTextColumn Binding="{Binding MyObject.Field1}" Header="F...

Create a fully transparent WPF window to capture mouse events

I'm trying to trap mouse events in WPF by using a topmost, transparent non-modal window. I'm finding that this works fine if the opacity of the window is 0.01 or greater and it has a background color, but when the opacity is set to 0 it no longer receives mouse messages. Is there a way make this window look fully transparent and still ...

Manual XBAP publishing.

I found a method to manually publish a regular WPF Application, but i need the same instructions for a WPF Browser app instead. Here is the regular WPF App howto: http://msdn.microsoft.com/en-us/library/xc3tc5xx%28VS.80%29.aspx . If anyone knows what changes I need to make to my mage commands to make it work for XBAP please let me know...

How to combine my seemingly redundant XAML

I have 8 different XAML DataTemplates that are all very similar. Here are 2 of them: <DataTemplate x:Key="ConflictFieldStringCellContentTemplate"> <StackPanel> <TextBlock Text="{Binding ClientVersion.Value}" Foreground="{Binding Path=Mismatch, Converter={StaticResource mismatchBoolToBrushConverter}}" /> ...

Are WPF and Silverlight on a collision course?

It seems like these two technologies, already similar, are on a path to merge into a single technology. There are a lot more WPF-like controls in the Silverlight toolbox, and WPF now has Silverlight's VisaulStateManager. At this point, it's probably fair to say that Silverlight has even surpassed WPF in terms of the number of themes avai...