MahApps.Metro:禁用Windows动画

Ale*_*aus 5 wpf mahapps.metro

我正在为我的WPF应用程序使用MahApps.Metro UI.这是一个很好的,满足我的需求,但如果有人告诉我如何在弹出时禁用Windows动画,我会更高兴.

当我调用Show()方法时,弹出新窗口,我看到一个恼人的动画(内容从右向左滑动).效果类似于下图所示的另一个效果(但它显示标签和内容从左到右):

弹出窗口上恼人的内容动画

虚拟表格样本请参见下文:

<controls:MetroWindow x:Class="TestProj.Views.TestView"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         mc:Ignorable="d" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
         xmlns:vm="clr-namespace:TestProj.ViewsModels"
         Height="230" Width="550">
<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.MergedDictionaries>
    </ResourceDictionary>
</Window.Resources>
    <Grid>
    </Grid>
</controls:MetroWindow>
Run Code Online (Sandbox Code Playgroud)

Joe*_*oee 17

在窗口中设置WindowTransitionsEnabled ="False".