我在xaml中对网格进行了更改,并添加了一个制表符控件。但是当项目打开时(通过F5),原始xaml显示而不是选项卡控件。然而,我在设计师中看到了标签控件。
我陷入停顿直到这个问题得到解决。感谢。
编辑添加:这似乎影响了xaml中的所有网格。我可以看到设计师的变化,但不能在项目打开时看到。
答案 0 :(得分:0)
谢谢你看看......
<Grid Visibility="Visible" x:Name="grdDefaults" Margin="0,100,0,0">
<Grid>
<Grid.Background>
<SolidColorBrush Color="Black" Opacity="0.5"/>
</Grid.Background>
<Grid.Resources>
<Style TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="#6B478E" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="18" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="Foreground" Value="#6B478E" />
</Style>
</Grid.Resources>
<Grid Background="#FFFFFF" Margin="225,37,27,33" HorizontalAlignment="Center" VerticalAlignment="Center" Width="1020" >
<Grid.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90" RenderingBias="Quality" ShadowDepth="2"/>
</Grid.Effect>
<Border BorderBrush="#6B478E" BorderThickness="2"></Border>
<TabControl HorizontalAlignment="Left" Height="492" Margin="10,100,0,0" VerticalAlignment="Top" Width="1000" Background="#FFFFFF" >
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Name="Border" Background="White" BorderBrush="#3C2F56"
BorderThickness="0.5,0.5,0.5,0"
Height="40" >
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Center"
ContentSource="Header"
Margin="10,0,10,0" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="White" />
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock.TextDecorations>
<TextDecoration Location="Underline" PenOffset="5">
<TextDecoration.Pen>
<Pen Brush="#6B478E" Thickness="4" />
</TextDecoration.Pen>
</TextDecoration>
</TextBlock.TextDecorations>
</TextBlock>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="#4C3C66" />
<Setter Property="FontSize" Value="14" />
<Setter TargetName="Border" Property="Margin" Value="1,1,1,-1" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FFFFFF" Offset="0"/>
<GradientStop Color="#FFFFFF" Offset="0.2"/>
<GradientStop Color="#F0F0F0" Offset="0.5"/>
<GradientStop Color="#F0F0F0" Offset="0.9"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="#8E88A3" />
<Setter Property="FontSize" Value="12" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="#D1CFDA"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>
<TabItem Header="Pricing">
<Grid Background="#FFFFFF" >
</Grid>
</TabItem>
<TabItem Header="Default Shipping">
<Grid Background="#FFFFFF" Margin="0,0,0,88">
</TabItem>
<TabItem Header="Miscellaneous Items Default">
<Grid Background="#FFE5E5E5" >
</Grid>
</TabItem>
<TabItem Header="Report Messages">
<Grid Background="#FFE5E5E5" >
</Grid>
</TabItem>
</TabControl>
</Grid>
</Grid>