wpf

How to hide close button in wpf window?

I'm writing a modal dialog in wpf. How do I set a wpf window to not have a close button? I'd still like for its WindowState to have a normal title bar. I found ResizeMode, WindowState, and WindowStyle, but none of those properties allow me to hide the close button but show the title bar, as in modal dialogs. ...

Help me find the best of WPF

I would like to find what people got the most out of using WPF, in particular: The best and stunning UI examples out there Dark corners that no other UI can implement with ease and style (say MFC or GTK) Professional examples with code Suggestions? Probably the best book on the subject is WPF in Action with Visual Studio 2008 ...

Filter a wpf collectionviewsource in VB?

Hi, I want to filter a collectionviewsource using a filter I've written, but I'm not sure how I can apply the filter to it? Here is my collection view source: <Grid.Resources> <CollectionViewSource x:Key="myCollectionView" Source="{Binding Path=Query4, Source={x:Static Application.Current}}"> <Colle...

WPF store layout in resources

Hello, I have application where default Window's borders switched off Window tag definition looks like this: <Window x:Class="TEA.UI.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Title" WindowStyle="None" AllowsTransparency="True" Background=...

Directly Navigating a Browser with an XBAP

Hi all, I'm working on a full-trust WPF browser application (XBAP) and have come across a snag. An application on the client is wired to handle navigation requests with a certain prefix/protocol. (For example, 'foo://...") Additionally, the application handles these differently depending on which browser creates the request. I've trie...

WPF Binding Converters

I am currently stuck at a dead end with the following situation: I have a List<Category> collection with each Category containing an Id, Name and a List<string[]> property called Subcategory (where array contains the Name and Id of that subcagtegory - I didn't feel like creating another class). I have a TreeView with HierarchicalDataTe...

Numbered listbox

I have a sorted listbox and need to display each item's row number. In this demo I have a Person class with a Name string property. The listbox displays a a list of Persons sorted by Name. How can I add to the datatemplate of the listbox the row number??? XAML: <Window x:Class="NumberedListBox.Window1" xmlns="http://schemas.microso...

How do I bind to a List<T> using DataContext?

I'm self-learning C#, OOP, and WPF so the potential for stuff ups is staggering. So given that, can someone please explain why after clicking the button in my tiny test example the Name property appears in the TextBox but the ListBox shows nothing? XAML: <Window x:Class="BindingTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2...

WPF Datagrid -DataGridTemplateColumn tab focus issue

I am using Microsoft WPF datagrid. I have noticed a strange behavior with WPF datagrid DataGridTemplateColumn. When you use the templateColumn in the grid and the template column contains some controls when you tab from the previous column the focus is not automatically given to the first element declared in the template column. The fouc...

WPF MVVM Binding Checkbox.IsChecked to a named item in a Dictionary<string, bool>

I have a group of checkboxes that all represent different selections of the same type (for my example, they are all different file types). I feel like binding each one to an individual property in the ViewModel is overkill, and I'd prefer to bind them all to one collection and use the binding syntax to bind each checkbox to a particular...

WPF: Icons in TreeView

Hi all, Please help to the newbie in WPF! I need to build a TreeView with icons+text in TreeViewItems when the Treeview is bounded to an XML data file. Here is my XML: <Root> <Node Name="AAA" Image="images/1.ico" /> <Node Name="BBB" Image="images/2.ico"> <ChildNode Name="bbb 1" Image="images/3.ico"> <GrandchildNode Name="b 1.1" Im...

Accessing a WPF GroupItem text for conversion in a template

I'm customising the appearance of grouping in a ListBox. In ListBox.Resources, I have declared something like (formatting removed): <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <StackPanel Orientation="Vertical"> <!-- ...

Testing a WPF Window with StaticResources

Hi, I have a simple Window with a reference to a StaticResource in the App.xaml App.xaml resource definition <!-- Standard Text Box Style --> <Style x:Key="textBoxStyleStd" TargetType="{x:Type TextBox}"> <Setter Property="FontSize" Value="14" /> </Style> Window componets using the resource <TextBlock Grid.Co...

[How] can I specify a dimension in 'pixel' units, as a resource (WPF)?

I've been trying to specify a dimension in pixels as a resource, so I can then use it in multiple places in my UI. e.g. ... <ResourceDictionary xmlns:System="clr-namespace:System;assembly=mscorlib"> <System:Double x:Key="a-width">140px</System:Double> </ResourceDictionary ... <TextBlock Width="{StaticResource a-width}" Text=...

WPF rendering is ugly and blurry on Vista

Can anyone explain why this simple WPF application looks so horrible on Vista? I've tried setting SnapsToDevicePixels, but this makes no difference. This is a clean WPF application, nothing added whatsoever except for the one button. Using VS 2008 SP1. In the IDE it looks perfect, but when running it is screwed. All WPF apps that I have ...

WPF: Displaying a Context Menu for a GridView's Items

I have the following GridView: <ListView Name="TrackListView" ItemContainerStyle="{StaticResource itemstyle}"> <ListView.View> <GridView> <GridViewColumn Header="Title" Width="100" HeaderTemplate="{StaticResource BlueHeader}" DisplayMemberBinding="{Binding Name}"/> <GridViewColumn Header="Artist" Width="100" HeaderTemplat...

How do build a VS-like propertypanel in WPF?

I got a TreeView containing different objects from different classes. Now I want to build a propertypanel, which shows up different content, depenting on what object/class is selected in the TreeView. What is the best way to build such panel? Differnt panels and collapsing panels depending on the selection(Whould make implementing the Ob...

What is the best way to organize WPF styles and ResourceDictionaries in a large project?

I have a large WPF application that uses a large number of styles, brushes, and theming. Managing the large number of styles with multiple developers is becoming difficult. Right now, most of our application-wide styles are in one resource dictionary and the theming brushes are each in their own resource dictionary. The issue is that...

In WPF, can you hittest segments of a PathFigure?

I'm making a control that involves dragging pieces of a displayed element around. Since part of it is an arc, I have to use a PathFigure so I can use ArcSegments. I'd like to be able to know if the mouse is over a particular segment of the figure, but I don't see an obvious way to do this. Is it impossible or am I missing something? ...

WPF or workflow?

Hey People, I have a question and hopefully you can steer me in the right direction. I'm working on an application that needs some form of decision tree/work flow for lack of a better term. I'll describe it below for some clarity. I have a request form that users will fill out on a web page. At the beginning of the form is a 'Referral...