wpf

WPF: How to combine Rows within a column (alternative to rowspan)?

Hi there, Is there a way to combine rows within a specific column? Hence to get something like this (I am currently using rowspan on a control i.e. Image but is there a better way?) -------------------- | |--------| | |--------| | |--------| | |--------| | |--------| -...

WPF ComboBox binding behaviour

I have the following XAML markup: <TextBox x:Name="MyTextBox" Text="{Binding Path=SelectedCustomer.FavouriteProduct.ProductNumber, UpdateSourceTrigger=PropertyChanged}" /> <ComboBox x:Name="MyComboBox" ItemsSource="{Binding Products}" DisplayMemberPath="ProductName" SelectedValue="{Binding Path=SelectedCustomer.FavouriteProduct.Prod...

WPF: Binding to the PasswordBOX in MVVM - working solution?

Hi there, I have come across a problem with binding to a passwordbox. It seems its a security risk but i am using the MVVM pattern so i wish to bypass this. I found some interesting code here (has anyone used this? or something similar?) http://www.wpftutorial.net/PasswordBox.html It technically looks great, but i am unsure how to ret...

19 Threads for WPF Appilcation

I just created a new WPF application which has about 5 windows and makes use of the Xceed Data Grid. After looking in the task manager I saw that this small application had 19 threads running. Can this be correct? I expected the WPF framework to use 2-3 threads, but not 19. Or am I doing anything wrong? ...

Underline Label in WPF, using styles

I have the following style: <Style x:Key="ActionLabelStyle" TargetType="{x:Type Label}"> <Setter Property="Margin" Value="10,3" /> <Setter Property="Padding" Value="0" /> <Setter Property="TextBlock.TextWrapping" Value="Wrap" /> <Setter Property="FontFamily" Value="Calibri" /> <Style.Triggers> <MultiTrigger>...

WPF (MVVM): Closing a view from Viewmodel?

Hi there, Anybody come across a clever way of closing a view in a viewmodel using MVVM? Maybe there is a way of using binding to signal the view (window) to close? I would really appreciate any input anyone has. Basically i have a loginView that is bound to a loginViewModel, in the viewmodel (using binding on a command) i test to see...

wpf debugging xaml

As part of learning wpf I'm working through some MS 'lab' sample apps; The finished exercise looks right, but I'm hitting a NullReferenceException with "Source code unavailable" issue (exception detail below). It appears to be thrown after the main window is shown. I suspect the issue is in the XAML, but the debugger isn't helping me a...

Why doesn't Visual Studio want me to add a new window to my WPF project?

Maybe a stupid question, but when I add item to a WPF project, Visual Studio only offers me UserControl, and not Window. Is this trying to encourage me to do MVVM, is my setup broken, or is there some other reason I haven't thought of? ...

What namespace must be used to get a DataGridComboBoxColumn?

I am writing an app in C# 3.5 in WPF. I want to programmatically add a DataGridComboBoxColumn in C# to a WPF toolkit DataGrid. The problem is that the control itself seems to not exist because I am missing either a directive or an assembly. I thought that System.Windows.Controls and by adding a reference to the WPFToolkit would handle th...

Is there a way to render SVG in winforms?

I am working with a library that renders part of its state as an SVG document. I would like to render this in either a Winforms or a WPF environment. Is there currently a way to do this? If not, I could modify the library to use a more general rendering strategy, and then add an XML adapter to restore the original functionality, but t...

Align top-left corner of VisualBrush's Visual into top left corner of rendered area

I am using a VisualBrush as part of a control template. I want the image to not be tiled or scaled, and the top-left corner of the target visual to be aligned to the top-left corner of the rectangle I am filling. The trouble is, without specifying absolute Viewbox units, I can't make this happen, and I can't use absolute viewbox units in...

Binding to AssemblyVersion in XAML (for Help/About dialogue)

Maybe I'm expecting too much here, but I figure I can't be the first person to have tried. Do I have to create (yet another) converter for this? ...

Having a rich treeview

Hi all, I need to create an user interface like "liquid xml studio" the designer part in c# or something like visual studio class designer interface . I think they are using treeview control but I dont understand how it's possible to have something like expandable groupboxes with other controls inside instead of tree nodes. Thanks ...

Using Styles in Windows Presentation Foundation

Imagine I have a data bound ListView and in the <ControlTemplate.Triggers> I have the following <DataTrigger Binding="{Binding Path=Status}" Value="Completed"> <Setter Property="Background" Value="{StaticResource CompletedBackground}" /> <Setter Property="Foreground" Value="Black" /> </DataTrigger> I want that to be bound to ...

Add Icon for ToolWindow in WPF

How can I add an Icon for ToolWindow in WPF? Just as <Window x:Class="WPFApp.Account" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Accounting Information" FontFamily="Calibri" FontSize="13" WindowStyle="ToolWindow" ResizeMode="NoResiz...

how to get list view reference in code .....that is inside Listview Resource

how to get list view reference in code .....that is inside Listview Resource ...

WPF Databinding and Styles with MVVM

I have a problem with databinding on a style in WPF. The basic setup looks like this: <Style x:Key="{x:Type eo:Player}" TargetType="{x:Type eo:Player}"> <Style.Triggers> <DataTrigger Binding="{Binding Team}" Value="A"> <Setter Property="Template" Value="{StaticResource TeamATemplate}"></Setter> </DataTrigger> ...

Dual NHibernate Class Level Validators Issue

I'm using WPF and I've got an Entity bound to a series of controls. The entity is decorated with two class level validators as follows: [ExampleValidator1, ExampleValidator2] public class Entity An Entity has a series of fields of which not all are always shown, dependent on the selection from combo box. A validator exists for each of...

AutoExpand treeview in WPF

Is there a way to automatically expand all nodes from a treeview in WPF? I searched and didn't even find an expand function in the treeview property. Thanks ...

WPF DataGrid binding problem

Lets say we have the following code in XAML (the datagrid is bound to an ObservableCollection and the column to a property of the ObservableCollection: <WpfToolkit:DataGrid ItemsSource="{Binding Path=Collection}" HorizontalScrollBarVisibility="Hidden" SelectionMode="Extended" CanUserAddRows="False" CanUserDeleteR...