wpf

Setting Column Background in WPF ListView/Gridview

I'm looking to set the background of a column in a WPF GridView. Many Google results have pointed towards setting the GridViewColumn.CellTemplate to change the appearance of a column. However, I'm met with an issue when setting the background color; it's not stretching to fill the cell: Here's the xaml I'm working with: <Window x:Cla...

WPF Listview : Column reorder event?

I need to sync the column order of two ListViews event when the user changes the order. But it seems there is not a Column reorder event. For the moment I just did a AllowsColumnReorder="False" but that is not a permanent solution. While searching the net I found many people with the same problem but no solution. What can be done? ...

Why can't I use the Name attribute on UserControl in the same assembly?

When I created a WPF UserControl and tried to use it, I got the following compiler error: Because 'UserControl1' is implemented in the same assembly, you must set the x:Name attribute rather than the Name attribute. The message is clear on what to do to fix it, but what is its cause? Why can't I use Name here? ...

WPF Navigation control

I need back/next buttons with dropdown history (like in Internet Explorer). The thing is, I need this in a UserControl and to databind the history to an IObservableCollection. I have my own class for navigating, I just need the navigation control. Can anyone suggest something? Thanks Pete ...

Converting XAML Textbox to C# with Validation

Hello I am trying to convert this xaml textbox with validation into C# so that it can be dynamically created and populated from code. I am getting stuck creating the validation bindings. Can anyone provide any hints? <TextBox Height="20" Width="200" > <Binding RelativeSource="{x:Static RelativeSource.Self}" Path="Text" > ...

Can't get WPF Listview to collapse when expanders in the listview collapse

I have a wpf listview with two expanders in it. When the expanders expand the listview makes room for the content. When they collapse the listview does not "take back" that extra space. I have set HorizontalAlignment and VerticalAlignment to Stretch everywhere. Is there a way to do this? The Details and Chart columns contain the exp...

WPF: Embedding TextBoxes in TextBox

Is is possible to embedd a TextBox in another TextBox. It does not have to be a TextBox, any editable text-component will suffice. I tried it with TextBox and got compiler errors. Reasoning: I want to create some kind of source code editor. I want that string literals in my source code are allowed to contain all kinds of special charact...

WPF UserControl TreeView Height

I have a user control which contains a StackPanel and TreeView. All controls have the Height="Auto" When I use the Cusotm control on a window and set Height, say Height=800 The STack Panel grows to this height, But the TreeView does not auto heigh adjust. UserControl: <UserControl x:Class="WPFDataBinding.ucCompanyTreeView" xmlns="h...

WPF: Localizing text that contains links

I have this window where I have a block of text that contains a link. Something like: Click here to read the documentation. Which means only the "here" in the sentence is a hyperlink. My problem is, I want to prepare this for localization. As a result, I have the text in resx files. So in the resx file I have "Click here to read the d...

Is that possible to create IE toolbar using WPF?

I just start learning WPF, is that possible I can create an IE toolbar by using WPF, if so, is there any document about how to do that? Thanks a lot. ...

strange behaviour in wpf datatemplate and property

I have a datatemplate that displays buttons in a stackpanel, whenever a user clicks at the button, the button is said to glow, so I have written the necessary datatrigger in the template and a boolean condition in the property that I'm binding too. Here are the details below <DataTemplate x:Key="ActionItemsTemplate" DataType="ActionItem...

How to fix the WPF form resize - controls lagging behind and black background?

I have a very simple WPF window - the only thing in it is a right-aligned button. When I resize the window by dragging the left boundary, the button jumps around - a lot. Try it yourself, drag the left boundary back and forth. Additionally, a black background becomes exposed temporarily during resizes. In this question, I asked a simil...

Validate ViewModel upon button click.

I have a ViewModel that implements IDataErrorInfo and a master-detail-view. How can I trigger the vaildation of the current ViewModel item when the user hits the save button in the detail view and not earlier? ...

In a WPF binding, how can I manipulate the data I'm binding, like, say concat two strings together?

I'd really like to be able to do some manipulation to the stuff I'm binding. Similar to being able to call String.Format() in a <%#%> tag in ASP.Net. For example, assuming this is the type I'm binding: class User { public string FirstName { get; set; } public string LastName { get; set; } public int Age { get; set; } } and t...

Visual studio how to get wpf and silverlight side by side

I have two projects in my solution one a silverlight library and the other a wpf control library, ive added the sources as a link from my silverlight library to my wpf library and after a bit of refatoring hit a road block, my wpf library project does not want to build the generated files needed for the code behind to recocnize the named...

WPF TypeConverter ConvertTo not firing

Hi, I have a dependency property in a class which I need to be converted to a string. I have added the TypeConverty attribute on the property. The type I am converting is the .net Style class. [TypeConverter(typeof(BulletStyleTypeConverter))] public Style BulletStyle { get { return (Style)GetValue(BulletStyleProper...

C# WPF fill datagrid or listview from XML file

I have a well formed XML file I would like to fill a datagrid with. I would prefer using the AutoGenerate feature of WFPToolKit datagrid, but could hard code the columns in. The trouble I am having is getting the xml file contents into a datagrid. I had it partially working in a listview, but think a datagrid would be more suited for m...

Why doesn't COALESCE work with RowFilter?

Hi. I'm developing a small application in WPF. I have a ListBox named NameListBox whose ItemsSource property is set to a DataView, and thus displays a list of customer names. The name is composed of 3 parts: FirstName, MiddleName, and LastName. I have used a converter to display the full name of customer in the list. Everything works fin...

move wpf behaviors APIs to .NET 4.0

Currently the whole behavior framework and APIs only come with expression blend (and its SDK) but I noticed that a crucial part of it resides in the namespace System.Windows.Interactivity. Does this mean that in a future version of the .NET framework, maybe even 4.0, behaviors will be part of the .NET Framework itsleft and do not require...

Manually instantiate a DataTemplate?

Is it possible to use a data template for a single item with no ListBox or other items control? I have a datatemplate that I want to instantiate in xaml, not in a list, just within a border, and set its datacontext. Something like (pseudo): <Window DataContext="{StaticResource Contact}"> <!-- Here I want to show a ContactT...