I have created a custom TreeView control and use the HierarchicalDataTemplate resource of this control from another page in the same project I'm trying to
This my.s.seneTemplate property is coming to null. I have stopped through all the objects in the dictionary and it exists.
How can I use this template?
Thanks
App.xaml
& lt; Application X: Class = "Foo.App" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http: // schema .microsoft.com / winfx / 2006 / XAML "StartupUri =" MainWindow.xaml "DispatcherUnhandledException =" App_DispatcherUnhandledException "& gt; & Lt; Application.Resources & gt; & Lt; ResourceDictionary & gt; & Lt ;! - Merge applications global resources - & gt; & Lt; ResourceDictionary.MergedDictionaries & gt; & Lt; Resource Source Source = "Resources / Global. XML" /> & Lt; Resource source source = "resource / scrollbar.xml" /> & Lt; Source source = "/ control / treeview / themes / generic .xml" /> & Lt; Resource source source = "/ control / list button / themes / generic .xml" /> & Lt; /ResourceDictionary.MergedDocs> & Lt; / ResourceDictionary & gt; & Lt; /Application.Resources> & Lt; / Application & gt;
I am trying to use the resource from my Scene.xaml.cs page
Public LeagueDataTemplateSelector () {if (Application.Current ! = Null) {This.sceneTemplate = (HierarchicalDepPlatform) application. Present. Fund resource ("view"); This.ItemTemplate = (HierarchicalDataTemplate) Application.Current.FindResource ("Process"); This.sub1Template = (hierarchicaldidplatform) Application.Current.FindResource ("subprogram1"); This.sub2Template = (hierarchicaldidplatform) application. Present. Findersource ("subprocessor 2"); }}
View HierarchicalDataTemplate
& lt; HierarchicalDataTemplate x: Key = "View" ItemsSource = "{Binding XPath = Level}" ItemContainerStyle = "{StaticResource RadTreeViewItemStyleSub1}" ItemTemplate = "{Static Resources Processor}" & gt; & Lt; Border & gt; & Lt; Grid & gt; & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "Auto" /> & Lt; Column width = "Auto" /> & Lt; /Grid.ColumnDefinitions> & Lt; Label VerticalContentAlignment = "Center" BorderThickness = "0" BorderBrush = "Transparent" Foreground = "{StaticResource ListItemUnHighlight}" FONTSIZE = "24" Tag = "{Binding XPath = @ name}" MinHeight = "55" Cursor = "Hand" Fontfamily = "aerial" keyboard navigation. Tab navigation = "none" name = "subtitle" & gt; & Lt; Label.ContextMenu & gt; & Lt; ContextMenu Name = "Edit Menu" & gt; & Lt; Menu item = "edit" /> & Lt; / ContextMenu & gt; & Lt; /Label.ContextMenu> & Lt; TextBlock Text = "{binding XPath = @ name}" vertical alignment = "center" textweeping = "wrap" & gt; & Lt; / TextBlock & gt; & Lt; / Labels & gt; & Lt; / Grid & gt; & Lt; / Border & gt; & Lt; / HierarchicalDataTemplate & gt;
update - answer
Our program has a breadcrumb control that works by navigating to the list of pages . This list of pages was being added during the splash screen before the initial version. I was taken above the page list code and now everything has been found in App.xaml.
Our program is a breadcrumb control that works by navigating to a list of pages is. This list of pages was being added during the splash screen before the initial version. I took it over the page list code and got everything in App.xaml.
Comments
Post a Comment