wpf - ControlTemplate for second level of TreeView -


I am trying to create a TreeView which has two levels but I can not find anywhere I have a ItemTemplateSelector (which works - to select any of the first two templates listed below), but I have not populated children using DataTemplate This is my code:

  Public class planned group group: INotifyPropertyChanged {public supervision collection & lt; PlannedMeal & gt; food; Public Stability Miletime militancy; ... // These change inotipproperty} & lt; Hierarchical DataTemplate X: Key = "GroupTemplate" Item Source = "{Binding Food}" & gt; & Lt; Text block text = "{binding path = miles}" /> & Lt; HierarchicalDataTemplate.ItemContainerStyle & gt; & Lt; Style TargetType = "{x: Type Tree VIIIIT}" & gt; & Lt; EventSaverter Event = "Trivitim. Predictmouse Right Buttonsdown" Handler = "Tray_ PreviewMouseRightButtonDown" /> & Lt; / Style & gt; & Lt; /HierarchicalDataTemplate.ItemContainerStyle> & Lt; / HierarchicalDataTemplate & gt; & Lt; DataTemplate x: key = "food template" & gt; & Lt; Border name = "border" margin = "4,2" padding = "3" background = "transparent" iHTTvv = "true" snappot devise pixel = "true" bordertyx = "0.6" corner radius = "3" & gt; & Lt; Name of boundary = "inner-border" background = "transparent" isHitTestVisible = "True" & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Image source = "{binding recipe symbol, converter = {static resource iconconverter}, converter parameter = 16}" stretch = "none" /> & Lt; TextBlock Text = "{binding converter = {static resource resizing converter}}" /> & Lt; / StackPanel & gt; & Lt; / Border & gt; & Lt; / Border & gt; & Lt; TreeView ItemTemplateSecler = "{Static Resource PlanMailTapTalTeCler}" style = "{static resource groupedview}" & gt; & Lt; TreeView.ItemsPanel & gt; & Lt; ItemsPanelTemplate & gt; & Lt; StackPanel IsItemsHost = "True" Orientation = "{Binding Orientation, Relative Soros = {x: Static RelativesSource.Templified Paint}}" /> & Lt; / ItemsPanelTemplate & gt; & Lt; /TreeView.ItemsPanel> & Lt; TreeView.ContextMenu & gt; ... & lt; Style x: key = "bundedTreview" target type = "{x: type tree viiIT}" & gt; & Lt; Setter property = "IEPanded" value = "true" /> & Lt; Setter Property = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: Type Tree VIIIIT}" & gt; & Lt; Border name = "border" margin = "4,2" padding = "3" background = "{static resource group backgroundbrush}" iHTTvv = "true" snappot devise pixel = "true" bordertyx = 0.6 "cornerradius =" 3 " Gt; & Lt; Expander Name = "Exp" IsExpanded = "{Binding IsExpanded, RelativeSource = {RelativeSource Ancestor Type = {x: Type treeViewItem}}, Mode = Dole}" & gt; & Lt; Expander.Header & gt; & Lt; ContentPresenter SnapsToDevicePixels = "{TemplateBinding SnapsToDevicePixels}" Horizontal Alignment = "{TemplateBinding Horizontal Content Alignment}" x: name = "PART_Header" ContentSource = "Header" /> & Lt; /Expander.Header> & Lt; Item presentation x: name = "itemhost" /> & Lt; / Expander & gt; & Lt; / Border & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; Style x: Key = "GroupedTreeView" TargetType = "TreeView" & gt; & Lt; Setter property = "item container style" value = "{static resource groupedview}" /> & Lt; / Style & gt;  

Thanks for any indication.

This problem me hours, so I'll post it to someone else in the first template There is a need to set the style for level objects.

  & lt; Hierarchical data template x: key = "group template" items source = "{binding food}" & gt; & Lt; Text block text = "{binding path = miles}" /> & Lt; HierarchicalDataTemplate.ItemContainerStyle & gt; & Lt; Style TargetType = "{x: Type Tree VIIIIT}" & gt; & Lt; EventSaverter Event = "Trivitim. Predictmouse Right Buttonsdown" Handler = "Tray_ PreviewMouseRightButtonDown" /> & Lt; Setter property = "background" value = "red" /> & Lt; Setter Property = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: Type Tree VIIIIT}" & gt; & Lt; ContentPresenter SnapsToDevicePixels = "{TemplateBinding SnapsToDevicePixels}" Horizontal Alignment = "{TemplateBinding Horizontal Content Alignment}" x: name = "PART_Header" ContentSource = "Header" /> ...  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -