9

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>
Alex Klaus
  • 8,168
  • 8
  • 71
  • 87

2 Answers2

22

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

Suplanus
  • 1,523
  • 16
  • 30
Joee
  • 1,834
  • 18
  • 19
0

As discussed on the equivalent GitHUb issue, the MetroWindow control template by default will use a MetroContentControl (which has this animation).

You need to edit the template to change it back to a ContentControl.

Sample code here

Brendan Forster
  • 2,548
  • 1
  • 24
  • 32
  • Two weeks ago I reported on the link above that your solution solves the issue, but the new window loses background colour of window title (now everything is white). I provided a simple example to demonstrate the problem, but nobody replied. Could you please at least confirm that you were able to reproduce my problem? – Alex Klaus May 19 '13 at 22:06
  • It turns out that white title background was a bug of last stable build. It's working fine with last beta version. – Alex Klaus May 24 '13 at 00:52