Update:
I've included some diagnostics in the SelectedValue property (diagnostics:PresentationTraceSources.TraceLevel=High) and I think I can see the issue, although I do not know how to fix it. The diagnostics show
System.Windows.Data Warning: 76 : BindingExpression (hash=16001149): TransferValue - got raw value '3'
System.Windows...
I have a xaml page that has an ItemsControl control on it. ItemsControl is bound to Guests which is ObservableCollection. Guests collection can have objects of two different types: USGuest and UKGuest, both inheriting from Guest. Is it possible to make two (or more) templates for ItemsControl and make it automatically choose between them...
Hi there,
I'd like to build an MRU menu that has the following structure:
File
+=>Recent Files
+=> Doc1.txt
+=> Doc2.txt
-separator-
+=> Clear entries
This being MVVM, my mru list is databound to the View Model. Because I want to add the separator, and I don't fancy inserting the separator and the clear entry action in th...
How come whenever I override the default template for a DataGridColumnHeader it can no longer be resized by the user even though CanUserResizeColumns is set to true for the datagrid? Is there something that I need to add to the template to restore this functionality?
Here's my template xaml:
<Style x:Key="ColumnHeaderStyle" TargetType=...
I would like to use the WPF and Silverlight toolkit's TreeView control, but have it be in the same xaml file that I share between 2 projects as a link. In silverlight, the class is in the System.Windows.Controls.dll and in WPF it is in PresentationFramework.dll. So for my xaml namespace, they need to be declared differently which cause...
I have a label in WPF which I want to restyle so it has rounded corners.
I have the below code already:
<Style TargetType="{x:Type Label}">
<Setter Property="Background" Value="Red"/>
<Setter Property="Margin" Value="2,2,2,2"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value...
I am trying to change the color of my label based off an enum set in xaml. I can not get the colors to update. Any help would be great.
Thanks!
<UserControl.Resources>
<!-- Normal -->
<SolidColorBrush x:Key="Normal_bg_Unselect" Color="#FF1A73CC" />
<SolidColorBrush x:Key="Normal_fg_Unselect" Color="#FF72BAFF" />
<Soli...
I would like to bind a Dictionary<string, List<int>> to a GridView in a ListView and I'm not having much luck.
I've looked at this question: wpf-binding-dictionarystring-liststring-to-listview-listbox-how, and this question: dictionary-binding-to-listview
But I'm not sure how to take their code and make it work for me.
Here's what I'v...
Hello all, I am hoping you can help me unravel an issue I am having with the use of a combo box.
Within my project I need to consume values from one collection and have these items display within my combobox . At this time I have built an observable collection that simply contains different involvement types
public ObservableCollection...
I have an object in my business layer (let's call it Car for example's sake), and I have created a UserControl (CarIcon). The user control has a property that is a Car object and when the Car object is set it calls a method that configures the various properties of the user control.
Now I am rewriting it to use dependency properties so...
I'm not sure how to go about this exactly. I have a static ObservableCollection in the NameField.cs class. I just have no idea how to bind it to the listbox.
Should I not be using a ListBox?
Should I be using a DependencyProperty?
Should I be exposing the ObservableCollection through a property or by public?
I'm not sure what to do h...
So i Got a tmplist of ObservableCollection in which i got few elements.
I connect it to the ItemsSource of DataGrid in WPF 4.0 and it doesn't show anything. Doesn't add any colums. If I add breakpoint I can see that the "ItemsSource count equals quantity of tmplist elements, but the Columns count equals 0. Why is that? Here is some code...
Hello:
I'm working on a simple WPF example and wanted to expand the example but I'm struggling, I'll explain some background first. I have three tables, people, addresses, and countries. As expected people live at an address, and addresses are located in a specific country.
I'm currently working through using a combo box as a lookup t...
I have a canvas property in my class and I was wondering if it's possible to bind that to a canvas in xaml?
How would the databinding work in the canvas?
<Canvas ItemSource="{Binding ClassCanvas}" />
...
I am looking for a way to create non-stroked regions for a StreamGeometry in xaml.
In other words, I want to know if it is possible to recreate the following code (taken from msdn) with the StreamGeometry Xaml markup syntax.
StreamGeometry geometry = new StreamGeometry();
geometry.FillRule = FillRule.EvenOdd;
using (StreamGeometryCont...
<dg:DataGrid Name="gridList" AutoGenerateColumns="False"
ItemsSource="{Binding ItemsInTable}" HeadersVisibility="Column" >
<dg:DataGrid.RowDetailsTemplate >
<DataTemplate x:Name="ItemDetails" >
<Border HorizontalAlignment="Stretch" CornerRadius="5" Background="Azure" >
<Stack...
In WPF it is possible to use the IsStroked property of a PathSegment to make the Segment invisible, I'm looking for a way to replicate this behavior in Silverlight, which doesn't have this property.
Is this possible?
[EDIT] I'm looking for a way to do this in code-behind, not in Xaml.
...
I would like to send a property changed event of the public property everytime the private member is set. How would I do this?
private string _imageName;
public string ImageName
{
get
{
return _imageName;
}
set
{
_imageName = value;
SendPropertyChanged("ImageName");
}
}
protected virtua...
Hi,
I was wondering if there is anyway to check if the up arrow or the bottom arrow of a wpf scroll viewer is clicked.
I am trying to do it within a wpf textbox but, I want it to snap to the next line of a text instead of displaying partial text.
So, the way for me to do this is when up/ or down is clicked.
i would say
textBox.lineup...
I'm trying to, find / come up with, a cool alternative to the old trusty rectangle-list-o-buttons context menu. I have seen some suggesting laying the item out circles in a circle, and they call it a pie-menu. And as you click a circle, it expands to have items around it etc.
(http://www.emphess.net/2008/05/04/a-menukiller-control-draft/...