itemcontainerstyle

WPF: Setting a binding for all TreeViewItem instance

Greetings, I'm using WPF with a Model-View-ViewModel pattern, and I have a view model with an IsSelected property which I want to bind to a TreeViewItem's IsSelected property for all TreeViewItems in the scope. I'm attempting to do this with a Style and a Setter. This works apparently for the root-level TreeViewItems, but not for their ...

How do I insert ToolBar separators when binding ItemSource

I am binding a ToolBar to a collection of command view model objects. The objects in the collection have a property IsSeparator that when true I would like represented with a <Separator/> in the ToolBar. My basic markup looks like this: <ToolBar Grid.Row="1" ItemsSource="{Binding Path=ToolBarCommands}"> <ToolBar.ItemTemplate> ...

Strange Behaviour WPF TreeView ItemContainerStyle and ItemTemplate

I just noticed some strange behaviour of WPF's TreeView. I added both ItemContainerStyle to bind to "IsSelected" of my ViewModel and an ItemsTemplated for custom display of my data. But now the user cannot change the selected node anymore. For testing purposes I created a similar UI using ListView and Expander. This version works as exce...

How to specify unique container styles for heterogenous hierarchies using SL3 and TreeView control

Hello, Just look for strategies that have been successful in rendering hierarchies that represent inheritance structures using SL3/4 TreeViews. I need to render certain nodes differently than others, depending upon what kind of container they are (a choice between things, or simply a list of related things, etc.) So far, I've been ver...

Having trouble with ItemContainerStyle on a Treeview ...

I have the following XML being set on my treeview: <Root Value="YES"> <Child Name="Test"> <Sibling Data="Yes"> <Last UserData="1"/> </Sibling> <Sibling Data="No"/> </Child> <Child Name="Test2"/> </Root> and then I have set the following code in my window: <Window.Resources> <XmlDataProvider x:Key="dataProvider" XPath="R...

Binding ListBoxItem.ItemSelected to the bound item in Silverlight

I am using MVVM pattern with Silverlight 4 to bind a collection of TODO items to a ListBox. There is a property IsSelected on each TODO entity. This allow for multiple selections to be made in the UI that are bound back to the ViewModel. At the same time any changes made by the ViewModel get reflected in the View. I am basically trying...

Specify ControlTemplate for ItemsControl.ItemContainerStyle

The following is similar to what I'm trying to accomplish. However, I get an "Invalid PropertyDescriptor value" error on the Template Setter. I suspect it's because I didn't specify a target type for the Style; however, I don't know the container type for ItemsControl. <ItemsControl> <ItemsControl.ItemContainerStyle> <Sty...

losing focus from listboxitem in silverlight

So heres the situation, i have a listbox that has a itemcontainerstyle with a template that contains a usercontrol. Inside this usercontrol is: <Grid Name="Label" MouseLeftButtonDown="Label_MouseLeftButtonDown" > <TextBlock Name="Text" /> </Grid> </Border> <Grid Name="Editor" Visibility="Collapsed" > ...

Focus and Selection Styling listbox items with multiple possible templates

Good afternoon, I have a listbox that consumes a list of items from a model, Addresses and RAddresses (inherited from Addresses) Now, previously I have been creating my item templates in the ItemContainerStyle so that I have only my own focus visuals (i.e. no dotted line, no light grey rectangle, etc). This has worked fine in the past...