Проблема Wpf menubar - menuitem не отображаются во время выполнения
Эй народ,
Я использую следующий код и понятия не имею, почему во время выполнения элементы меню не отображаются.
Ценю вашу поддержку:)
Что я уже пробовал:
<pre><Window x:Class="FFApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:FFApp" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="FFApp" Width="1360" Height="768" MinWidth="{Binding WindowMinimumWidth}" MinHeight="{Binding WindowMinimumHeight}" AllowsTransparency="true" FontFamily="Yu Gothic" WindowStartupLocation="CenterScreen" WindowStyle="None" mc:Ignorable="d"> <Window.Resources> <Style TargetType="{x:Type local:MainWindow}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Window}"> <!-- Outer border with the dropshadow margin --> <Border Padding="{Binding OuterMarginSizeThickness, FallbackValue=10}"> <Grid> <!-- Opacity mask for corners on grid --> <Border x:Name="Container" Background="{StaticResource BackgroundLight}" CornerRadius="{Binding WindowCornerRadius, FallbackValue=10}" /> <!-- Window border and dropshadown --> <Border Background="{StaticResource BackgroundGold}" CornerRadius="{Binding WindowCornerRadius, FallbackValue=10}"> <Border.Effect> <DropShadowEffect Opacity="0.8" ShadowDepth="0" /> </Border.Effect> </Border> <!-- The main window content --> <Grid> <!-- Corner clipping --> <Grid.OpacityMask> <VisualBrush Visual="{Binding ElementName=Container}" /> </Grid.OpacityMask> <Grid.RowDefinitions> <!-- Header --> <RowDefinition Height="{Binding TitleHeightGridLength, FallbackValue=32}" /> <!-- Input Area --> <RowDefinition Height="*" /> </Grid.RowDefinitions> <!-- TitleBar --> <!-- Header --> <Menu > <MenuItem Header="_File"> <MenuItem Header="_New..." /> <Separator /> <MenuItem Header="_Open..." /> <Separator /> <MenuItem Header="_Save" /> <MenuItem Header="_Save As..." /> <Separator /> <MenuItem Header="_Exit" /> </MenuItem> <MenuItem Header="_Edit"> <MenuItem Command="Cut" Header="_Cut" /> <MenuItem Command="Copy" Header="_Copy" /> <MenuItem Command="Paste" Header="_Paste" /> </MenuItem> <MenuItem Header="_View" /> <MenuItem Header="_Window" /> <MenuItem Header="_Help" /> </Menu> </DockPanel> <!-- Working Frame --> <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <!-- Working section --> <ColumnDefinition Width="8*" /> <!-- Result Overview --> <ColumnDefinition Width="125" /> </Grid.ColumnDefinitions> <Grid> <Grid.RowDefinitions> <RowDefinition Height="9*" /> <RowDefinition Height="9*" /> <RowDefinition Height="{Binding TitleHeightGridLength, FallbackValue=32}" /> <!-- Same like Title height --> </Grid.RowDefinitions> <!-- InputBar --> <TabControl Grid.Row="0" Grid.Column="0"> <TabItem Header="General"> <Label Content="Content goes here..." /> </TabItem> <TabItem Header="Security" /> <TabItem Header="Details" /> </TabControl> <StackPanel Grid.Row="2" Orientation="Horizontal"> <Label Name="Info" Margin="10,2,2,2" HorizontalAlignment="Left" Content="Info: " FontWeight="ExtraBold" Foreground="{StaticResource TextStandardBright}" /> <Label Name="InfoTexts" Width="800" Margin="10,2,2,2" HorizontalAlignment="Left" HorizontalContentAlignment="Left" FontWeight="Normal" Foreground="{StaticResource TextStandardBright}" /> </StackPanel> </Grid> <!-- Results Overview --> <StackPanel Grid.Column="1" Margin="0,2,2,2" Background="{StaticResource BackgroundGold}" /> </Grid> </Grid> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <WindowChrome.WindowChrome> <WindowChrome CaptionHeight="{Binding TitleHeight}" CornerRadius="0" GlassFrameThickness="0" ResizeBorderThickness="{Binding ResizeBorderThickness}" /> </WindowChrome.WindowChrome </Window>