我在我的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>发布于 2016-09-07 11:30:19
在窗口的xaml中设置WindowTransitionsEnabled="False"。
发布于 2013-05-02 05:29:06
正如在等效的GitHUb问题上讨论的那样,默认情况下,MetroWindow控件模板将使用一个MetroContentControl (其中有此动画)。
您需要编辑模板才能将其更改为ContentControl。
样本代码这里
https://stackoverflow.com/questions/16313161
复制相似问题