wpf

Is there any command to update UI immediately?

I want to update a progress bar from running 1 to 100 with this code. for (int i = 0; i <= 100; i++) { System.Threading.Thread.Sleep(100); progressBar1.Value = i; } But the result is, the UI freeze until looping finish. I know Dispatcher can help, but I don't want to split function. Is there any command to update UI immediat...

What is a "Freezable" subtype in WPF/Silverlight?

What is a "Freezable" subtype in WPF/Silvellight? ...

Property inheritance in WPF/Silverlight?

In WPF and Silverilght, what are the rules for deciding if you inherit properties from the visual, declarative, or logical parent? ...

Update property on view model without code behind?

I'm using a TreeView inside a Combobox control (from here). I have a ViewModel object that is the DataContext of my window. What I would like to have happen is when the selected item in the treeview/combobox changes I want a property on my ViewModel to be updated with that selected item. Ideally I'd like to be able to do this completely...

searching and listing WPF resource dictionaries in a folder

I'm making a WPF application that is going to have multiple skins branded in by our build system. Ideally we would like the application to list off the skins available as some builds will have one to many skins. At runtime is there a way to enumerate all the Resource Dictionaries in a specific folder? I want to avoid hard coding the ...

WPF - Style for the scrollbars and background on a RichTextBox

What's required to create a style for a RichTextBox that includes visuals for the scrollbars and a background color for the space behind the text? ...

WPF WebBrowser control doesn't enter design mode when the document property is changed

Dear LazyWeb, I have a frustrating problem. Here's a simplified version of what I'm doing: A UserControl in c# contains a toolbar and an embedded WebBrowser object. The toolbar contains an "Edit" button, which when clicked sets the webbrowser control in design mode. Another button, "Cancel", turns off design mode. Pseudocode (very sim...

Event Aggregation...What exactly is going on?

Hi, I have often times wondered about it but now that I have encountered a piece of logic that incorporates it, I thought I should go ahead and get some help on deciphering the fundamentals. The problem is as follows, I am looking at a WPF application that is utilizing the Composite Application Library. Within the source of the applicat...

TreeListView Displaying different information than it's parent. WPF

Hi. I have tree list view NOT A tree view. I would like it to display different information than the parent. With the different columns I want to have the parent to display: Name Task and Activity code. The CHild to display Start Time End Time and Total Hours. But i would like the child columns to match the parent columns such ...

WPF - How to expose subelements of a UserControl

I have created a XAML UserControl that is used to enter the current date using some up/down controls. The interesting parts of the UserControl are as follows: <UserControl x:Class="MyApp.Controls.DateEntry" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uCon...

TwoWay MultiBinding with read-only properties

How to skip updating some of the sub-bindings of a MultiBinding? I have defined in code-behind (I had some troubles making it in XAML and I don't think it matters - after all code-behind is not less expressive then XAML) a MultiBinding which takes two read-only properties and one normal property to produce a single value. In case of Conv...

WPF - datagridview options

Hi all, Need to represent a two column table. Maybe just for reference at this stage - or with the functionality that a double click presents a combobox essentially on that field with all the possible values that can be entered. Is datagridview the best option for this in WPF or what else could I do to represent the data? Cheers, ...

Very basic WPF layout question

Hi All, <StackPanel> <GroupBox> <StackPanel Orientation="Horizontal"> <ListBox></ListBox> </StackPanel> </GroupBox> </StackPanel> How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I've tried width="auto" Height="auto", width="stretch...

WPF - Bind Menu Item

Hello, I am creating a menu and binding the menu items ate runtime as follows but I am not able to make it work. I am creating the menu as follows: Menu menu = new Menu(); menu.Items.Add(new MenuItem { Command = new PackCommand(), Header = "Pack" }); DockPanel.SetDock(menu, Dock.Top); content.Children.Add(menu); And ...

WPF: ObjectDataProvider (with LINQ to XML) or XmlDataProvider---which do you prefer?

I've just read “How to perform WPF Data Binding using LINQ to XML” and this leads me to the question, ObjectDataProvider (with LINQ to XML) or XmlDataProvider---which do you prefer? Should I just fall in love with the XAML-based LINQ to XML approach or are there performance issues here? This is a snippet from the aforementioned article:...

What does the WPF star do (Width="100*")

What does exactly the star in size terms in WPF mean? ...

how to get current position in 3d? how to highlight 3d line when mouse move on?

we used WPF library come from http://3dtools.codeplex.com, we used TrackballDecorator and ScreenSpaceLines3D to display 3d lines and 3d axis. the ScreenSpaceLines3D provide rotation and zoom functions. we want added a HitTest method for 3d lines. we can highlight the line when mouse move on it. we plan to get current position in 3d, b...

How to use JpegBitmapDecoder in Systems.Windows.Forms.UserControl

Is there a way that I can use the BitmapFrame returned from JpegBitmapDecoder in the UserControl.OnPaint() method? I was told that the performance of JPEG decoding from Systems.Windows.Media.Imaging is much better than the one in GDI+ used by Systems.Windows.Forms library. However, my application is written with Systems.Windows.Forms l...

Change context menu in WPF TreeView for data

Is there a way to specify in a TreeView's HierarchicalDataTemplate to use a different context menu depending on a property on the data an item is bound to? For instance, display one context menu if Item.IsFile is true, display a different one if Item.IsFolder is tree, etc. ...

Need Mock XAML data at design time

I'm using a static array of objects defined in XAML as my ItemsSource on a list box. I use: ItemsSource="{Binding Source={StaticResource theSource}}". This works great at design time. However, I need to override this at run time so the list box will take it's items from a collection property on my view model. I exposed a Property ...