Search code examples
wpfmahapps.metro

MahApps.Metro: Disabling windows animation


I'm using MahApps.Metro UI for my WPF application. It's a good one and satisfies my needs, but I'd be more happy if somebody told me how to disable windows animation when they pop up.

When I call the Show() method, the new window pops up and I see an annoying animation (the content slides from right to left). The effect is similar to another one shown on the picture below (but it shows tabs and content goes left-to-right):

Annoying content animation on popup

Sample of a dummy form please see below:

<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>

Solution

  • Set WindowTransitionsEnabled="False" in xaml of the window.