wpf

WPF ListBox Width / MaxWidth

I have a databound ListBox with a DataTemplate setup. The DataTemplate contains a Grid control with two column widths of Auto and *. I would like this column to always fill the ListBoxItem and never extend past the LisBox control to make the horizontal scrollbar visible. I am able to bind the MaxWidth to the DataTemplate's grid using:...

WPF XML DataBinding

I'm trying to do some WPF databinding, but I'm a little hung up at the moment. I have two listboxes and an XML file. The first listbox successfully binds to the XML source. However, when I try to bind to a child of the selected item from first listbox as the source for the second list box, nothing appears. The goal being something like a...

Change desktop wallpaper using code in .NET

How can I change the desktop wallpaper using C# Code? ...

How can I bind an ObservableCollection to TextBoxes in a DataTemplate?

I am trying to successfully TwoWay bind an ObservableCollection to TextBoxes in a DataTemplate. I can get the data to display properly, but I am unable to change the list data through the UI. I have a Model class named 'model' which contains an ObservableCollection named 'List'. The class implements the INotifyPropertyChanged interface. ...

WPF XAML StringFormat DateTime: Output in wrong culture?

I'm having some trouble with the output of a DateTime value. My computer's current culture is set to de-AT (Austria). The following code string s1 = DateTime.Now.ToString("d"); string s2 = string.Format("{0:d}", DateTime.Now); results in s1 and s2 both having the correct value of "30.06.2009". But when using the same format in XAML ...

Call other element inside WPF Tree in Style

My point is this. For test i need when user check chk1 the chk2 element changed the property IsEnabled to False, but i can't do reference to chk2 element. This is Style XAML. <Style x:Key="styleCheckBox" TargetType="{x:Type CheckBox}"> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> ...

what is the best way of getting the ICollectionView when working in mvvm pattern?

when using mvvm pattern, when we have lists we use ObservableCollection<>. my question is when should i call to CollectionViewSource.GetDefualtView(theCollection); to get the view that i can filter and sort and do some other cool stuff. if i dont work with mvvm i'll do it in window.load ...

How to set the Color of a WPF Toolkit Datagrids Corners?

Hi, Does anyone know how to set the Corner-Color of a WPF Toolkit DataGrids Scrollbar? It would be nice if the upper Corner would use the same Style as the ColumnHeaderStyle and the lower Corner would be transparent. Image Thanks in advance! ...

how to add customized buttons to the existing Messagebox in WPF

how to add customized buttons to the existing Messagebox in WPF ? Apart from the usual ok and cancel button i need to add 3 more buttons and also i need to handle the events of these buttons.. How is it possible? please help me ...

WPF snapping controls

Hello everyone, my current free-time project, in order to dive into WPF MVVM, is a "digital" copy of an old puzzle I used to play a lot in my childhood. It basically is a simple puzzle where one has to fill a given space with different kind of pieces so the whole space is filled. But with the extra twist of being in hexagonal space. ...

Gridsplitter stretch limits - WPF

I would like to set some limits/boundaries on the amount of pixels we can stretch a gridsplitter control which is inside a grid.How is this possible? Basically one should not be allowed to pull the gridsplitter to large limits(it should be restricted to smaller grid boundaries) ...

Show selected item in a DataGrid within a ComboBox

I have a WPF toolkit DataGrid as the dropdown in a ComboBox template. <toolkit:DataGrid x:Name="InnerGrid" ItemsSource="{TemplateBinding ItemsSource}" CanUserReorderColumns="False" CanUserResizeColumns="True" CanUserSortColumns="False" CanUserResizeRows="False" A...

WPF CheckBox with "Button" appearance

I need a button-like control that can have a Checked property, so that when clicked it stays pressed. I had that functionality in WinForms, with the CheckBox control, setting the Appearance property to "Button". Can someone help me? ...

How to Customize Animation in Blend?

I'm developing a small application using Blend, basically what I have in my application are two list views, lets call them List View A and List View B. List View A represent the files in my computer that I want to sent to the server and List View B represent the files that are in the server. What I want to do is to create a transition ...

WPF Validation.Errors Contains Nothing

I am having problems displaying the Validation.Errors in my ItemsControl. The Validation.Errors does not contain anything. I am NOT using BindingGroup but I use my own custom TextBoxes. Here is the ItemsControl code: <ItemsControl x:Name="errorList" ItemsSource="{Binding Path = (Validation.Errors), ElementName=gvAddCustomer}" > ...

How to define PasswordBox type column in DataGrid?

How to make a column in WPFToolkit:DataGrid PasswordBox like? ...

How to bind Close command to a button

The easiest way is to implement ButtonClick event handler and invoke Window.Close() method. But how to do this through a command binding? ...

Are WPF binding properties Path and XPath mutually exclusive?

Suppose I have a UserControl whose DataContext is set to an object that has an XmlDataProvider property. I would like to bind to this property in my control's XAML, and specify some XPath. I tried this: <TreeView ItemsSource="{Binding Path=PropertyName, XPath=/items/item/*}"> At runtime I get the exception "BindingExpression with XPat...

WPF Treeview - Get status of checkbox.

Hi, I have created a Treeview and used a stack panel to include a checkbox, icon image and text for each node in the tree. These nodes are created at runtime. I also have a button object. The xaml is below. The problem i have is that, when the click me button is clicked, i need to traverse thru the tree view and if a checkbox is checked...

How to constraint a TextBox

How to make TextBox possible to get only certain values. e.g. DateTime input box with defined format settings. ...