Blend 和 VS2010 之间的形式看起来不同

发布于 2024-10-20 17:29:56 字数 2526 浏览 7 评论 0原文

当在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

公布 2024-10-27 17:29:56

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文