Blend 和 VS2010 之间的形式看起来不同
当在 Blend 4 中查看附加表单时,它在设计和运行时都按应有的方式显示。在VS2010中查看时,它在设计窗口中显得非常不同。然而,运行时它看起来是正确的。有什么线索吗? 这是代码:
<Window
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="LibraWPF.frmLoadTips"
x:Name="Window_MainLoadTips"
Title="Load Tips" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize" Background="{x:Null}" Visibility="Visible" AllowsTransparency="True" Height="164" Width="305" IsEnabled="True" SizeToContent="Manual" MinWidth="305" MinHeight="164">
<Border Margin="0,0,8,8" d:LayoutOverrides="HorizontalAlignment" BorderThickness="1,0,1,1" >
<Border.BorderBrush>
<SolidColorBrush Color="{DynamicResource HeaderBkgd}"/>
</Border.BorderBrush>
<Border.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="2" Color="#FF707070" RenderingBias="Quality"/>
</Border.Effect>
<Grid x:Name="LayoutRoot" >
<Grid.Background>
<SolidColorBrush Color="{DynamicResource LibraContainerBkgd}"/>
</Grid.Background>
<Label Content="Load Tips" Height="27.333" VerticalAlignment="Top" FontFamily="Segoe UI Symbol" FontSize="14.667" >
<Label.Background>
<SolidColorBrush Color="{DynamicResource HeaderBkgd}"/>
</Label.Background>
</Label>
<Label Content="Select Tip Load Position:" HorizontalAlignment="Left" Height="27.491" Margin="37.684,41.427,0,0" VerticalAlignment="Top" Width="154.473" FontWeight="Bold"/>
<ComboBox Margin="220.002,41.427,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="36" IsEditable="True"/>
<Button Content="Go" Margin="37.684,91.173,0,0" x:Name="btnLoadTipsGo" Height="53.672" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100.437" />
<Button Content="Cancel" Margin="160.739,91.173,0,0" IsCancel="True" IsDefault="True" Click="btnLoadTipsCancel_Click" x:Name="btnLoadTipsCancel" Height="53.672" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100.437" />
</Grid>
</Border>
</Window>
When the attached form is viewed in Blend 4, it appears as it should during both design and run time. When viewed in VS2010, it appears very different in the design window. However, it appears correct when running. Any clues?
This is the code:
<Window
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="LibraWPF.frmLoadTips"
x:Name="Window_MainLoadTips"
Title="Load Tips" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize" Background="{x:Null}" Visibility="Visible" AllowsTransparency="True" Height="164" Width="305" IsEnabled="True" SizeToContent="Manual" MinWidth="305" MinHeight="164">
<Border Margin="0,0,8,8" d:LayoutOverrides="HorizontalAlignment" BorderThickness="1,0,1,1" >
<Border.BorderBrush>
<SolidColorBrush Color="{DynamicResource HeaderBkgd}"/>
</Border.BorderBrush>
<Border.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="2" Color="#FF707070" RenderingBias="Quality"/>
</Border.Effect>
<Grid x:Name="LayoutRoot" >
<Grid.Background>
<SolidColorBrush Color="{DynamicResource LibraContainerBkgd}"/>
</Grid.Background>
<Label Content="Load Tips" Height="27.333" VerticalAlignment="Top" FontFamily="Segoe UI Symbol" FontSize="14.667" >
<Label.Background>
<SolidColorBrush Color="{DynamicResource HeaderBkgd}"/>
</Label.Background>
</Label>
<Label Content="Select Tip Load Position:" HorizontalAlignment="Left" Height="27.491" Margin="37.684,41.427,0,0" VerticalAlignment="Top" Width="154.473" FontWeight="Bold"/>
<ComboBox Margin="220.002,41.427,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="36" IsEditable="True"/>
<Button Content="Go" Margin="37.684,91.173,0,0" x:Name="btnLoadTipsGo" Height="53.672" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100.437" />
<Button Content="Cancel" Margin="160.739,91.173,0,0" IsCancel="True" IsDefault="True" Click="btnLoadTipsCancel_Click" x:Name="btnLoadTipsCancel" Height="53.672" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100.437" />
</Grid>
</Border>
</Window>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VS 2010 xaml 编辑器在解析设计时资源方面表现不佳。在 SilverLight 或 WPF 中工作时,我通常会同时打开 Studio 和 Blend。
The VS 2010 xaml editor does a poor job resolving design-time resources. I usually have both Studio an Blend open at the same time when working in SilverLight or WPF.