wpf

Launch a WPF window

Hi, Im uprading a .Net 2.0 project to 3.5. In the current project The code "System.Windows.Forms.Application.Run(winForm);" creates the initial windows form I am wondering if anyhow can tell me whats the equivalent to call a WPF window. Any help or advice really apprecaited. Steve ...

WPF DataGrid: Get column binding property for filtering

I am trying to develop a filtering functionality for WPF DataGrid (from the WPF Toolkit). I want a user to right-click any cell and select "Filter" from its context menu, and then the grid should be filtered by the cell's value. I am trying the M-V-VM pattern. My windows's datacontext is MainWindowViewModel which has a property "Transac...

Customize the shape of a scatterview

I'm currently using the Surface SDK 1.0 in Blend and VS2008, and I've encountered a problem: I use a scatterview over the whole screen. I also have a grid in the middle of the screen. The panel in the middle is quite annoying because my scatterviewitems can easily get lost BEHIND the grid, and since the grid is locked in position, there ...

Split the width evenly between of two controls that make up a listbox item?

Hi, I'm trying to setup a ListBox so that every item has a textblock and a combobox, split evenly across the width of the listbox but I can't seem to find the magic combination of ColumnDefinition properties to do it. Here's my DataTemplate for the listbox item. I've cleaned it up since it was wrong, anyhow. <DataTemplate x:Key...

Bind WPF ComboBox SelectedValue-property to multiple objects

Let's say I have a list of Customers (List) and each Customer has a State-property. Is it possible to bind the SelectedValue of a ComboBox, so that it shows (has a SelectedValue of) e.g. "WA" if all Customers have WA as their State? If the customers have different State-values nothing is shown. But if I then choose OR, then all Custome...

TextBox binding in WPF

Hi I have a textbox in XAML file, On Changing the text in the textbox the prop setter is not getting called. I am able to get the value in ProjectOfficer textbox and not able to update it. I am using MVVM pattern Below is my code XAML TextBox Text="{Binding Path=Officer,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ...

What is the best C# collection with two keys and an object?

I've got a MenuManager class to which each module can add a key and and element to be loaded into the main content: private Dictionary<string,object> _mainContentItems = new Dictionary<string,object>(); public Dictionary<string,object> MainContentItems { get { return _mainContentItems; } set { _mainContentItems = value; } } So...

WPF Binding to property and setting another

I'm using MVVM in my WPF application. I have a Window that has a view inside it. In that view a value can be changed and I will bind it to a TextBox in my main Window: <TextBox Text="{Binding Path=myViewModel.MyValue"> </TextBox> Now I would need to bind this myViewModel.MyValue to a property inside my main window view model, so t...

Composite WPF (Prism) module resource data templates

Given that I have a shell application and a couple of separate module projects using Microsoft CompoisteWPF (Prism v2)... On receiving a command, a module creates a new ViewModel and adds it to a region through the region manager. var viewModel = _container.Resolve<IMyViewModel>(); _regionManager.Regions[RegionNames.ShellMainRegion].Ad...

SQL Reporting Services 2005 vs WPF Fixed Document Control

Hi In my project i have used WPF and am following MVVM pattern. So i have a report module in my project and the reports are just plain reports. So i would like to know should i use SQL Reporting Service 2005 to create reports and then use report viewer as client or should i go for WPf Fixed Document Control- Document viewer. Can anyo...

What software do i need to install to use WPF in VS2005

Hi All, I have VS2005 and .net 3.5 installed on my machine I have heard of WPF and want to practice WPF solutions what other software should I install to write WPF program in VS2005 as it does not show any option for the same by default. Also any link for some cool stuff for beginners on WPF will be very helpful. Please help ...

WPF GridViewHeader styling questions

I'm trying to set up my very first WPF ListView/GridView and having trouble with styling the column headers. I currently have 3 issues. Here is a view of the GridView as it is right now: I want to remove the little white vertical borders that seperate the column headers. I want to remove the mouseover effect. This screenshot has t...

Can't Insert new record from WPF Datagrid via LINQ-to-SQL

Ok, what I'm doing is (I think) rather simple. I have a LINQ-to-SQL data context set up and one of the tables is Users. In the designer, it shows the class as "User" with the source as "dbo.Users". It's access is Public, and I can reach the database to retrieve and update just fine. The class is set to "Use Runtime" for the I/D/U ope...

Silverlight - How do I make each item in a list box be the same height?

How can I make a silverlight listbox have all items be the same size and have them take up 100% of the listbox height. I.e. 1 item would be the height of the listbox, 2 items would each be 50% of the height of the list box, etc... Edit - Here is the code public class UniformPanel : Panel { protected override Size MeasureOverride(S...

ListBox DataTemplate Binding With Two Lists

Hi, I'm databinding a listbox to an object that contains two array of strings. Each listbox item is set to a data template made up of a textbox and a combo box. The first string array is bound to the list, and the second string array is bound to the combo box. Well, at least that's I'm trying to achieve. The problem is that I can't figu...

How Can I Nest Custom XAML Elements?

<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" Title="Window1"> <Grid> <local:ElementType x:Name="FirstElementName"> <local:ElementType x:N...

Does WPF's GridView have vertical borders?

Is there a way to set a vertical border on a WPF GridView? The following works great for some nice horizontal borders. Is there a good way to add vertical borders to the GridView that lives inside this ListView? <Style x:Key="ListViewItemBase" TargetType="{x:Type ListViewItem}"> <Setter Property="BorderThickness" Value="1" /> <Set...

How exactly do Attached Properties work in WPF?

I'm a bit mystified as to how Attached Properties actually convey their values to either parent or child elements. TextElement.FontFamily causes child elements to inherit the value assigned to that property (a seemingly downstream operation, parent to child). Grid.Column causes a parent item to display that child in a particular position...

WPF ListView - Sorting by Nested Properties

I have recently stumbled across an issue where the WPF ListView control seems to be restricting the ability to sort its items. Specifically, I am having a great deal of trouble trying to get a SortDescription to recognise nested properties (properties of properties). For straight-forward sorting by propreties, the following line should ...

WPF : using a designed vector image as a control template in WPF

Hi, I am exploring the idea of using professionally designed vector images as the ControlTemplates in my WPF application. The idea is to make several types of controls, each with a different visual design, which can then be dragged and dropped. This is exactly the same use-case as a visual designer (a'la visio) I have the following XAM...