wpf

Is there no simple way to set WPF StatusBar text?

I want to set the Text of a TextBlock in my StatusBar before making the user wait for a short moment while my program does a little bit of work. Aparently, instead of doing a nice little function like this (which does not work): Function Load(ByVal Id As Guid) As Thing Cursor = Cursors.Wait TextBlockStatus.Text = "Loading..." ...

Passing image throught wcf and display them in wpf datagrid

Whats the best way to pass an image in wcf service, and after passing it display it in a wpf datagrid? ...

WPF ObjectDataProvider and Mouse.GetPosition(IInputElement relativeTo)

I am attempting to bind the position of a camera to the relative position of a mouse's position in a 3D environment. Using an ObjectDataProvider I would imagine I can call this method and then bind to it, however, I'm not sure what to put in the ObjectDataProvider.MethodParameters, I'd like to reference the named Viewport3D from outside...

Where to store application settings/state in a MVVM application

I'm experimenting with MVVM for the first time and really like the separation of responsibilities. Of course any design pattern only solves many problems - not all. So I'm trying to figure out where to store application state and where to store application wide commands. Lets say my application connects to a specific URL. I have a Conn...

WPF - Hovering over one Element shows content in another Element

I would like to achieve an affect whereby I can hover over a Button and have a TextBlock update its content (via binding). To complicate matters, The Button is one of many buttons defined in an ItemsControl/DataTemplate. The TextBlock is outside the scope of the ItemsControl. Some simplified markup of the problem is as follows: <Grid> ...

WPF ObjectDataProvider with static method GetPosition of Mouse

I am attempting to use an ObjectDataProvider to call the GetPositition method of Mouse, but am getting this error: System.Windows.Data Error: 34 : ObjectDataProvider: Failure trying to invoke method on type; Method='GetPosition'; Type='Mouse'; Error='No method was found with matching parameter signature.' MissingMethodException:'System....

WPF DataGrid

How to set paging in wpf datagrid? Plz give me some samples. Thanks Vijay. ...

Using WPF Imaging classes - Getting image dimensions without reading the entire file

Hi guys Link this post I want to be able to read an image files height and width without reading in the whole file into memory. In the post Frank Krueger mentions there is a way of doing this with some WPF Imaging classes. Any idea on how to do this?? Cheers Anthony ...

[WPF] ComboBox Style problems with DisplayMemberPath

I have a ComboBox and I have set the combo.ItemsSource property to a List object. The Book class contains two properties: "Abbreviation" and "Name". I have set the ComboBox's DisplayMemberPath to "Abbreviation" but the following style that is set on the ComboBox does not display the Abbreviation property, but instead shows "Words.Book" ...

Picture (logotype) in Vista window header

There is a nice feature in modern windows applications for vista. It is picture in the window header. For instance new skype (v4) and google chrome have it. I was woundering what is technology behinde it? If you switch off aero style, windows still has decaration. Probably application totaly redraw window frame. However, I didn't find ...

How to bind the Selected Item to a Model with the Infragistics XamDataGrid?

I have the following model: public class Model : INotifyPropertyChanged { public ObservableCollection<ViewElement> Elements { get; set; } public ViewElement CurrentElement { get; set; } } And the following grid where the parent DataContext is the above model: <dg:XamDataGrid DataSource="{Binding Path=Elements}" /> I want to ...

DateTime Format in C#

Hey guys, I experiencing a strange behavior of C#. Its some thing like this.. var date = DateTime.Now.ToString("MM/dd/yyyy"); I expecting out to be 04/24/2009 but in actuall its returning 04-24-2009 and my OS culture is en-GB, I'm using .Net 3.5 and WPF any solutions please... ??? ...

Why is WPF application running in debug mode slow?

Hi there, I know that running applications in DEBUG (build configuration) thru the visual studio adds a level of overhead but I have a WPF application that I am testing out that is painfully slow in its execution and other functions such as drag/drop of items. When I run the application in Release mode it performs like one would expect...

How to build dynamic data entry forms in a WPF application?

I'm planning a WPF application which will be able to create dynamic data entry forms (meaning the form gets the fields to display, their order, etc. from data in the database, not from the XAML) use the MVVM pattern if possible Here is how I plan to go about it: in a Customer Data Entry View I would set the data context: <UserContro...

WPF: Binding to selected TreeViewItem

Hi all, I have a treeview that built on XML file and contains a text and an image in TreeViewItem. Also, I have any TextBlock and an Image, that I want to bound to the selected TreeViewItem. How to do this? Thanks in advance! Here is my XAML: <Window.Resources> <HierarchicalDataTemplate DataType="Node" ItemsSource ="{Binding XPath=C...

WPF: Changing Resources (colors) from the App.xaml during runtime

I am trying to make my application more customizable by allowing users to pick a color from a Color Picker dialog, and then changing the style of the application in real time (with DynamicResource) How do I go about in changing specific resources that reside in the app.xaml ? I have tried something like this but no luck (just a test)...

Can you have different item-text and item-values when using ObjectDataProvider?

When setting the source of an items control (ComboBox, for example), is it possible to have the SelectedValue property be different than the text that is displayed. I have a ComboBox that I want to display only the time portion of a DateTime, and have the value of each item be the DateTime object itself. Thanks! ...

WPF C# System.Deployment Problem

I'm developing an XBAP application in C# and want to be able to use the System.Deployment object methods. In the object browser, I'm able to see all the object, when I try and access these methods via the code, it will not work and states that the methods are not in the name space. Any suggestions? ...

Why is Converter not called when Collection changes?

I made a CollectionToStringConverter which can convert any IList into a comma-delimited string (e.g. "Item1, Item2, Item3"). I use it like this: <TextBlock Text="{Binding Items, Converter={StaticResource CollectionToStringConverter}}" /> The above works, but only once when I load the UI. Items is an ObservableColle...

XamlReader.Load(XmlReader) "Stack Empty" XamlParseException

I'm trying to load a xaml file at runtime. My code looks like this: StringReader stringReader = new StringReader(xamlString); XmlReader xmlReader = XmlReader.Create(stringReader); content = XamlReader.Load(xmlReader); It's basically copy paste of of msdn. the XamlReader.Load line throws a XamlParseE...