所以,我正在制作一个窗口打开的动画,除了一个关键部分之外,动画看起来非常适合我正在尝试做的事情......窗口所在的位置和动画中当前所在的位置之间的空间是黑色的盒子。
我用谷歌搜索了很多,但我没有看到任何地方提到这个问题!
我也在标准窗口中尝试过,除了黑框仅显示在窗口边框内之外,没有其他区别。除了 Visual Studio 为我生成的任何代码之外,我的代码隐藏为零。
这是我的窗口:
<Controls:MetroWindow x:Class="Schedule.MainWindow"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="mainWindow"
Title="MainWindow" Height="350" Width="525" WindowStartupLocation="CenterScreen">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Window.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" x:Name="winTransform1"/>
</Window.RenderTransform>
<Window.RenderTransformOrigin>
<Point X=".5" Y=".5"/>
</Window.RenderTransformOrigin>
<Window.Triggers>
<EventTrigger SourceName="mainWindow" RoutedEvent="Window.Loaded">
<BeginStoryboard Name="openBoard">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="winTransform1" Storyboard.TargetProperty="ScaleX"
From="0" To="1" Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<Grid>
</Grid>