wpf

Build a treeview in WPF

I am trying to build a three level treeview in WPF. Basically, I have a list of top level items that all have one more child items. Those child item may or may not have themselves chid items. Anyone know of a tutorial available on the net? ...

How to update binding dynamically when source object changes?

What I have? I have Frame in XAML, (binding works properly). <Frame Name="frmMainContent" DataContext="MyPageInformation" Source="{Binding ElementName=thisPage, Path=MyPageInformation.UserControlPath}" NavigationUIVisibility="Hidden"></Frame> In the code behind I have a DependencyProperty of my ...

How do I sort hierarchical data in WPF?

I am creating a menu that will have its menu items injected into it from different modules (I am using the Composite Application Library: Unity, Prism). Example: File - Open - New - A (injected from ModuleA) - B (injected from ModuleB) - C (injected from ModuleC) - Exit Because I don't know which items will be injected, I need...

WPF Get UserControl owner

Hello, so I have this UserControl that's inside of another UserControl. Lets call them ParentUC and ChildUC. I need to get ParentUC from ChildUC. I know to get the window owner would be Window.GetWindow(userControl), but UserControl doesn't have a method like this AFAIK. Thanks for the help! ...

What is the state of SWT to WPF port?

A while ago I read about a WPF port of Eclipse and SWT. I can't find any recent information about it. What is the current status of the WPF port? Will it be available before E4? Any other details about the implementation also welcome. ...

How can I make an "Accordion Widget" in WPF?

The goal: I'm trying to achieve something like this in WPF: An initial solution: At the moment, I'm trying to use an ItemsControl with an ItemTemplate composed of an Expander. I want a consistent look for the Header portion of the Expander, but I want the Content portion of the Expander to be completely flexible. So, it's basical...

WPF ItemsControl: Can't seem to get items to display in the view

The code I'm working on is part of a WPF application that should display a set of stacks of playing cards that the user can interact with. So there's three UserControls I'm working with: MainControl CardStackControl CardControl In MainControl.xaml: <StackPanel Grid.Row="0" Orientation="Horizontal"> <Ite...

WPF frameworks: Which one should I prefer?

There is a similar question already asked at SO: http://stackoverflow.com/questions/1409553/what-framework-for-mvvm-should-i-use But what I would like to know is whether any of these WPF frameworks are actually production ready? I really don't want to use any framework which is not well supported or are just half baked attempts. And b...

Why does my table get not printed when I try to define column widths?

Hi! I'm printing a table using WPF FlowDocument. It works as long as I don't assign any width to the table columns. Once I set the width to any custom value (not auto), the printer output is empty. Does anybody have some ideas why this happens? Best Regards Oliver Hanappi ...

WPF TextBlock: How to evenly space displayed characters?

Hi All, I need to display a string with each character displayed every x pixels. (x is accross the whole string). e.g.: "Hello" -> H at position (pixel) 0, e at position 50, l at 100, l at 150, o at 200. Of course I could use a TextBlock for each character but it seems overkill. TranslateTransform doesn't seem to do the trick: It of...

C# Help changing property value dynamically (Reflection)

Hello, I'm trying to write a simple config in C# that reads XML and customizes the components (Buttons, Tabs ETC) accordingly. My first snag is calling a component, attribute and value from variables. Here is a small working snippet but not how I want it to work as I’m not passing the component name dynamically. (Dummy button added to C...

WPF DataGrid Virtualization with Grouping

I'm using the WPF DataGrid from CodePlex and I need to get Virtualization to work with grouping. This question is on topic and points to an MSDN Example but it only covers ListControls with with simple (i.e. single 'column') DataTemplates. Grouping and Virtualization seems like a pretty common use case for a Grid. Is there a standard...

WPF Net3.5 WebBrowser HTMLElement Mouse Click

Ive been using a WIndowsFormHost to host a Windows.Forms.WebBrowser control and adding a event handler to fire when the mouse is clicked on a HTML element inside the control ((System.Windows.Forms.WebBrowser)sender).Document.Click -= new System.Windows.Forms.HtmlElementEventHandler(htmlElementClick); This works well!!! I want ...

In WPF, how can I inherit from ToolBar AND have a XAML file?

I can inherit and enhance the ToolBar class by creating a plain C# class, then doing this: public class NiceToolBar : ToolBar { private ToolBarTray mainToolBarTray; public NiceToolBar() { mainToolBarTray = new ToolBarTray(); mainToolBarTray.IsLocked = true; this.Background = new SolidColorBrush(Colo...

How to show listview horizontally in WPF ?

Hi, How to show headers in rows instead of columns and bind the data.So that all the binded values will increase number of columns instead of number of rows. ListView.View is set as GridView. Please help. Thanks, ...

WPF binding user control with data in C# code

I've create user control like this: public partial class View { public View() { InitializeComponent(); } public static DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(TeaserView) ); public string Name { get { return...

Wpf Data Binding using IMultiValueConverter and casting errors

As part of learning WPF I just finished working through an MS Lab Exercise called "Using Data Binding in WPF" (http://windowsclient.net/downloads/folders/hands-on-labs/entry3729.aspx). To illustrate using an IMultiValueConverter, there is a pre-coded implementation of one where the boolean result is used to determine whether the data bi...

wpf databinding testing

I'm in the process of learning WPF, where one of the strong suits is supposed to be data binding. When I do a win forms app, because I don't trust data binding much, I use what Fowler would call an assembler and just do it by hand, which makes it easy to test also. I've read Jeremy Miller's blog enough to see he has issues with data bin...

DrawingImage always draws in upper left, regardless of coordinates supplied

I'm attempting to draw a set of images in and Image in WPF, potentially off from top left, but no matter what I do, either the Image, the DrawingImage or the DrawingGroup are causing the image that is closest to the top left corner to default to the top left corner of the image. Here's the code: XAML: <Canvas Grid.Column="1" Name="Can...

How to group consecutive similar items of a collection?

Consider the following collection. True False False False True True False False I want to display it in a structured way, say, in a TreeView. I want to be able to draw borders around entire groups and such. True Group True False Group False False False True Group True True False Group False False How do I accomplish this ...