wpf

WPF TabPanel without the Tabs?

Ok I admit, what I need is not a tabpanel, (or is it?). But what I effectively want is a panel with a number of children I can select one of which to be visible at any given time. Basically I have a couple views and based on the state of the app, the current view needs to change. This is essentially like Regions from Composite Applica...

Best approach for WPF multi-column list view

I have a ListView with a lot of data (200+ items) so to save space it's making use of a UniformGrid to display 3 columns instead of 1 <ListView.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="3" /> </ItemsPanelTemplate> </ListView.ItemsPanel> I also modify the style so that each item is aligned to the top <List...

Issue with control layout when using Validation.ErrorTemplate

I have a custom control which is hosted in a Window with some other controls on it. The custom control and the window are in different assemblies as the custom control is to be shared across several applications. Within the window I define a style for type FrameworkElement and then in that style I set the ControlTemplate to utilize an ...

Can you implement Model-View-ViewModel using Powershell and WPF using PowerBoots?

Are there any examples of this? I haven't been able to find anything on google that shows how to implement this design practice using powerboots. ...

WPF Styling border thickness on trigger...

I have the following style defined... <!-- Blue Button --> <Style x:Key="BlueButton" TargetType="{x:Type Button}"> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border Name="border" BorderThickness...

WPF C# binding code - why doesn't this simple example work?

Hi, I've attached some WPF C# binding code - why doesn't this simple example work? (just trying to understanding binding to a custom object). That is when clicking on the button to increase the counter in the model, the label isn't updated. <Window x:Class="testapp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/x...

A better way to dynamically fill in the TreeView

I want to dynamically construct a TreeView using Node which represents a typical tree node. The Node looks like class Node { public Node(string cont) { Content = cont; Children = new List<Node>(); } public string Content { get; set; } public List<Node> Children { get; set; } public bool IsLeaf { ...

a converter returning ContentPresenter - strange result

I'm really confused with ContentPresenter. I want to build a converter having on input a resource name and returning a new ContentPresenter containing a new instance of that resource. Seems to be obvious and straightforward, but when I apply it in xaml the content will... jump between places where it is used: The converter: public...

How can I add items after setting itemsource to ListView

I got exception : Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead. ...

TargetType="{x:Type GroupItem}" arrow style in wpf

How to change arrow style for ...

Drag N drop images in a viewbox

I have a usercontrol with 6 viewbox, each can have an image. I have not set the width or height of the usercontrol(not even the viewboxes). At first the viewboxes are empty.I can add the images dynamically. <Grid x:Name="DashBoardGrid" DockPanel.Dock="Right"> <Grid.RowDefinitions> <RowDefinition Height="20"></RowDef...

WPF radio button binding - getting an error in this code here??

Trying to get radiobuttons binding working but getting a run time error with the code below. Want the radio buttons to act such that only one can be selected at a time, and that they bind correctly in a 2 way fashion. Error text is. "The invocation of the constructor on type 'testapp1.MainWindow' that matches the specified bin...

Bounds rectangle of selected controls in wpf

Is there a simple way to find the rectangle (area and location) that would be required to cover a set of control?? VisualTreeHelper.GetDescandentBounds() works fine, but there are no overloaded methods where I can specify the controls that it should consider for finding the bounds rectangle. Any simple solution will be greatly appreciate...

Load Resources ".resx" from folder in Silverlight.

I have a multilanguage application and customer wants to edit Resources.resx files like he wants. I created silverlight project and add some files: Resources.resx Resources.en-US.resx1. Resources.uk-UA.resx2. They all have build action "Embedded Resource" Everything is working but Those files are embeded to XAP file. And customer...

WPF User Controls and DataBinding

Hi all, I guess I'm a bit stuck on the mechanism of WPF DataBinding. Up to now I've thought of it as this : Any target of a DataBinding has to be a DependencyProperty.Keeping that in mind, I designed a very simple button-based UserControl like the following (boiled down to the most necessary parts): XAML <Button x:Class="MyNamespace.I...

Is there a way to programmatically convert other Xaml elements to path elements?

In Blend, it is possible to convert certain Xaml elements to Path, using Object->Path->Convert to Path option. Is there some API to do the same programmatically, in a WPF application? Thanks ...

Error: The name 'tBox' does not exist in the current context.

Error: The name 'tBox' does not exist in the current context. XAML: <ItemsControl Name="itemsControl"> <ItemsControl.Template> <ControlTemplate> <WrapPenel> <ItemsPresenter/> </WrapPenel> </ControlTemplate> </ItemsControl.Template> <Item...

Is there a way for two DataTemplates to share some elements?

Something like a template or base DataTemplate which both DataTemplates extend or inherit so I don't have to duplicate XAML. ...

Microsoft Ribbon for WPF vs Infragistics Ribbon

Microsoft released Microsoft Ribbon for WPF (you can download it here). At the moment I am using Infragistics Ribbon. And question is: which one is better? Infragistics Ribbon control has resource washing (wchich I am using) and I don't think that WPF Ribbon has it. Also I heard that WPF Ribbon has some bugs. But probably WPF Ribbon...

Overrule style in style

Hi all, Is it possible to override styles in other styles. My best description will be some non working code: <Style x:Key="SpecialFont" TargetType="Label"> <Setter Property="Foreground" Value="Red" /> <Setter Property="FontSize" Value="28" /> </Style> <Style TargetType="GroupBox"> <Setter Property="GroupBox.Resources"> ...