When I try to animate my main window only Height is getting animated, however when i use the same code to animate my grid it is working fine.Please help me out, as i am new to wpf
<Window x:Class="TestingDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TestingDemo"
mc:Ignorable="d"
Name="myWindow"
AllowsTransparency="True"
WindowStyle="None"
Background="Blue"
Title="MainWindow" Height="100" Width="100">
<Grid>
<TextBlock MouseDown="TextBlock_MouseDown">
OpenMe
<TextBlock.Triggers>
<EventTrigger RoutedEvent="MouseDown">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="myWindow"
Storyboard.TargetProperty="Height"
From="100"
To="600"></DoubleAnimation>
<DoubleAnimation
Storyboard.TargetName="myWindow"
Storyboard.TargetProperty="Width"
From="100"
To="600"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
</Grid>
</Window>
W
Here is what i am doing for the same and it works like a charm:
Please be careful as it is not advised to push frames manually but if you know what you're doing then knock yourself out! :).