Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf MahApps.Metro:禁用windows动画_Wpf_Mahapps.metro - Fatal编程技术网

Wpf MahApps.Metro:禁用windows动画

Wpf MahApps.Metro:禁用windows动画,wpf,mahapps.metro,Wpf,Mahapps.metro,我正在为我的WPF应用程序使用UI。这是一个很好的工具,满足了我的需求,但如果有人告诉我如何在弹出窗口时禁用windows动画,我会更高兴 当我调用Show()方法时,新窗口弹出,我看到一个恼人的动画(内容从右向左滑动)。其效果与下图所示的另一个效果类似(但它显示选项卡,内容从左到右): 虚拟表格示例请参见以下内容: <controls:MetroWindow x:Class="TestProj.Views.TestView" xmlns="http://schemas

我正在为我的WPF应用程序使用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>

正如在同等GitHUb问题上所讨论的,默认情况下,
MetroWindow
控件模板将使用
MetroContentControl
(具有此动画)

您需要编辑模板以将其更改回
ContentControl


示例代码

在窗口的xaml中设置
WindowTransitionEnabled=“False”

两周前,我在上面的链接中报告,您的解决方案解决了问题,但新窗口失去了窗口标题的背景色(现在所有内容都是白色)。我提供了一个简单的例子来说明这个问题,但是没有人回答。你能至少确认一下你能重现我的问题吗?原来白标题背景是上一个稳定版本的bug。它与上一个测试版配合得很好。