wpf中的窗口转换

时间:2012-09-28 04:27:37

标签: .net wpf animation

我正试图在Window上进行淡入淡出。我能够进行转换,但仅限于窗口的内容。我的意思是窗口和标题栏的框架不像其中的内容那样转换。请检查下面的XAML代码,看看整个窗口需要做什么才能淡入。

<Window x:Class="WpfApplication6.newwindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="newwindow" Height="295" Width="371" PreviewStylusInRange="Window_PreviewStylusInRange">
<Window.Triggers>
    <EventTrigger RoutedEvent="Window.Loaded">
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd" />
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>


<Grid Height="257" Width="349">
    <Label Content="Label" Height="28" HorizontalAlignment="Left" Margin="115,0,0,112" Name="label1" VerticalAlignment="Bottom" Width="127" Background="#FFDB1F1F" />


    </Grid>

我正在使用VS 2010和.NET 3.5。

谢谢。

0 个答案:

没有答案