Answer the question
In order to leave comments, you need to log in
Why is the template not working?
there is a template in resourcedictionary
<Style TargetType="controls:NeoWindow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:NeoWindow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Menu Name="mainMenu" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<MenuItem Header="sadf"/>
</Menu>
<TabControl Name="tabList" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
</TabControl>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<controls:NeoWindow x:Class="WpfApplication4.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300"
xmlns:controls="clr-namespace:WpfApplication4" Loaded="NeoWindow_Loaded">
<controls:NeoWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WpfApplication4;component/Dictionary1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</controls:NeoWindow.Resources>
</controls:NeoWindow>
((Menu)this.Template.FindName("mainMenu", this)).Items.Add(new MenuItem() { Header = "qwe" });
First step to handle exception of type 'System.NullReferenceException' in WpfApplication4.exe
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question