Skip to content

Commit 3181ded

Browse files
committed
Merge pull request #292 from ButchersBoy/transition-api
Transition API!
2 parents 015868c + 8184891 commit 3181ded

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1632
-7
lines changed

MainDemo.Wpf/MainWindow.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}"
4343
DockPanel.Dock="Top"
4444
HorizontalAlignment="Right" Margin="16"
45-
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
45+
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
4646
<ListBox x:Name="DemoItemsListBox" Margin="0 16 0 16" SelectedIndex="0"
4747
PreviewMouseLeftButtonUp="UIElement_OnPreviewMouseLeftButtonUp">
4848
<ListBox.ItemTemplate>
@@ -163,6 +163,11 @@
163163
</wpfExample:Dialogs>
164164
</domain:DemoItem.Content>
165165
</domain:DemoItem>
166+
<domain:DemoItem Name="Transitions">
167+
<domain:DemoItem.Content>
168+
<materialDesignDemo:Transitions />
169+
</domain:DemoItem.Content>
170+
</domain:DemoItem>
166171
<domain:DemoItem Name="Shadows">
167172
<domain:DemoItem.Content>
168173
<wpfExample:Shadows />

MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,37 @@
147147
<Compile Include="TextFields.xaml.cs">
148148
<DependentUpon>TextFields.xaml</DependentUpon>
149149
</Compile>
150+
<Compile Include="Transitions.xaml.cs">
151+
<DependentUpon>Transitions.xaml</DependentUpon>
152+
</Compile>
153+
<Compile Include="TransitionsDemo\Slide1_Intro.xaml.cs">
154+
<DependentUpon>Slide1_Intro.xaml</DependentUpon>
155+
</Compile>
156+
<Compile Include="TransitionsDemo\Slide2_Intro.xaml.cs">
157+
<DependentUpon>Slide2_Intro.xaml</DependentUpon>
158+
</Compile>
159+
<Compile Include="TransitionsDemo\Slide3_Intro.xaml.cs">
160+
<DependentUpon>Slide3_Intro.xaml</DependentUpon>
161+
</Compile>
162+
<Compile Include="TransitionsDemo\Slide4_CombineTransitions.xaml.cs">
163+
<DependentUpon>Slide4_CombineTransitions.xaml</DependentUpon>
164+
</Compile>
165+
<Compile Include="TransitionsDemo\Slide5_TransitioningContent.xaml.cs">
166+
<DependentUpon>Slide5_TransitioningContent.xaml</DependentUpon>
167+
</Compile>
168+
<Compile Include="TransitionsDemo\Slide6_MVVM.xaml.cs">
169+
<DependentUpon>Slide6_MVVM.xaml</DependentUpon>
170+
</Compile>
171+
<Compile Include="TransitionsDemo\Slide7_Master.xaml.cs">
172+
<DependentUpon>Slide7_Master.xaml</DependentUpon>
173+
</Compile>
174+
<Compile Include="TransitionsDemo\Slide7_MasterModel.cs" />
175+
<Compile Include="TransitionsDemo\Slide8_Details.xaml.cs">
176+
<DependentUpon>Slide8_Details.xaml</DependentUpon>
177+
</Compile>
178+
<Compile Include="TransitionsDemo\TransitionsDemoHome.xaml.cs">
179+
<DependentUpon>TransitionsDemoHome.xaml</DependentUpon>
180+
</Compile>
150181
<Compile Include="Trees.xaml.cs">
151182
<DependentUpon>Trees.xaml</DependentUpon>
152183
</Compile>
@@ -253,6 +284,46 @@
253284
<SubType>Designer</SubType>
254285
<Generator>MSBuild:Compile</Generator>
255286
</Page>
287+
<Page Include="Transitions.xaml">
288+
<SubType>Designer</SubType>
289+
<Generator>MSBuild:Compile</Generator>
290+
</Page>
291+
<Page Include="TransitionsDemo\Slide1_Intro.xaml">
292+
<SubType>Designer</SubType>
293+
<Generator>MSBuild:Compile</Generator>
294+
</Page>
295+
<Page Include="TransitionsDemo\Slide2_Intro.xaml">
296+
<SubType>Designer</SubType>
297+
<Generator>MSBuild:Compile</Generator>
298+
</Page>
299+
<Page Include="TransitionsDemo\Slide3_Intro.xaml">
300+
<SubType>Designer</SubType>
301+
<Generator>MSBuild:Compile</Generator>
302+
</Page>
303+
<Page Include="TransitionsDemo\Slide4_CombineTransitions.xaml">
304+
<SubType>Designer</SubType>
305+
<Generator>MSBuild:Compile</Generator>
306+
</Page>
307+
<Page Include="TransitionsDemo\Slide5_TransitioningContent.xaml">
308+
<SubType>Designer</SubType>
309+
<Generator>MSBuild:Compile</Generator>
310+
</Page>
311+
<Page Include="TransitionsDemo\Slide6_MVVM.xaml">
312+
<SubType>Designer</SubType>
313+
<Generator>MSBuild:Compile</Generator>
314+
</Page>
315+
<Page Include="TransitionsDemo\Slide7_Master.xaml">
316+
<SubType>Designer</SubType>
317+
<Generator>MSBuild:Compile</Generator>
318+
</Page>
319+
<Page Include="TransitionsDemo\Slide8_Details.xaml">
320+
<SubType>Designer</SubType>
321+
<Generator>MSBuild:Compile</Generator>
322+
</Page>
323+
<Page Include="TransitionsDemo\TransitionsDemoHome.xaml">
324+
<SubType>Designer</SubType>
325+
<Generator>MSBuild:Compile</Generator>
326+
</Page>
256327
<Page Include="Trees.xaml">
257328
<SubType>Designer</SubType>
258329
<Generator>MSBuild:Compile</Generator>

MainDemo.Wpf/Transitions.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<UserControl x:Class="MaterialDesignDemo.Transitions"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:transitionsDemo="clr-namespace:MaterialDesignDemo.TransitionsDemo"
7+
mc:Ignorable="d"
8+
d:DesignHeight="300" d:DesignWidth="300">
9+
10+
<transitionsDemo:TransitionsDemoHome />
11+
</UserControl>

MainDemo.Wpf/Transitions.xaml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignDemo
17+
{
18+
/// <summary>
19+
/// Interaction logic for Transitions.xaml
20+
/// </summary>
21+
public partial class Transitions : UserControl
22+
{
23+
public Transitions()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<UserControl x:Class="MaterialDesignDemo.TransitionsDemo.Slide1_Intro"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:MaterialDesignDemo.TransitionsDemo"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
8+
mc:Ignorable="d"
9+
d:DesignHeight="300" d:DesignWidth="300"
10+
>
11+
<materialDesign:ColorZone Mode="Light" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
12+
<StackPanel VerticalAlignment="Center">
13+
<TextBlock>Welcome to the transitions showcase! Take the red pill to begin...</TextBlock>
14+
15+
<!-- you can easily use the move next, previous, first and last commands -->
16+
<Button Style="{DynamicResource MaterialDesignFloatingActionButton}" Margin="64"
17+
Command="{x:Static materialDesign:Transitioner.MoveNextCommand}">
18+
<materialDesign:PackIcon Kind="Pill" />
19+
</Button>
20+
</StackPanel>
21+
</materialDesign:ColorZone>
22+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignDemo.TransitionsDemo
17+
{
18+
/// <summary>
19+
/// Interaction logic for Slide1_Intro.xaml
20+
/// </summary>
21+
public partial class Slide1_Intro : UserControl
22+
{
23+
public Slide1_Intro()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<UserControl x:Class="MaterialDesignDemo.TransitionsDemo.Slide2_Intro"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
7+
mc:Ignorable="d"
8+
d:DesignHeight="300" d:DesignWidth="300">
9+
<materialDesign:ColorZone Mode="PrimaryLight" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch">
10+
<Grid VerticalAlignment="Center" HorizontalAlignment="Center"
11+
MaxWidth="600">
12+
<Grid.RowDefinitions>
13+
<RowDefinition />
14+
<RowDefinition />
15+
</Grid.RowDefinitions>
16+
<TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="32"
17+
Style="{DynamicResource MaterialDesignHeadlineTextBlock}"
18+
TextWrapping="Wrap">
19+
The transition will originate from where the user clicks the button. Experiment with the back/forward buttons.
20+
</TextBlock>
21+
<Button Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
22+
Command="{x:Static materialDesign:Transitioner.MovePreviousCommand}"
23+
HorizontalAlignment="Left"
24+
Grid.Row="1">
25+
<materialDesign:PackIcon Kind="StepBackward" />
26+
</Button>
27+
<Button Style="{DynamicResource MaterialDesignFloatingActionAccentButton}"
28+
Command="{x:Static materialDesign:Transitioner.MoveNextCommand}"
29+
HorizontalAlignment="Right"
30+
Grid.Row="1"
31+
>
32+
<materialDesign:PackIcon Kind="StepForward" />
33+
</Button>
34+
</Grid>
35+
</materialDesign:ColorZone>
36+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignDemo.TransitionsDemo
17+
{
18+
/// <summary>
19+
/// Interaction logic for Slide2_Intro.xaml
20+
/// </summary>
21+
public partial class Slide2_Intro : UserControl
22+
{
23+
public Slide2_Intro()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<UserControl x:Class="MaterialDesignDemo.TransitionsDemo.Slide3_Intro"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
7+
mc:Ignorable="d"
8+
d:DesignHeight="300" d:DesignWidth="300">
9+
<materialDesign:ColorZone Mode="PrimaryDark" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch">
10+
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="64">
11+
<TextBlock Style="{DynamicResource MaterialDesignHeadlineTextBlock}" TextWrapping="Wrap" TextAlignment="Center">OK, we've seen some cool stuff. Let's take a look at some more transition types.</TextBlock>
12+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
13+
<Button Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
14+
Command="{x:Static materialDesign:Transitioner.MovePreviousCommand}"
15+
VerticalAlignment="Center"
16+
Margin="16">
17+
<materialDesign:PackIcon Kind="StepBackward" />
18+
</Button>
19+
<Button Style="{DynamicResource MaterialDesignFloatingActionAccentButton}"
20+
Command="{x:Static materialDesign:Transitioner.MoveNextCommand}"
21+
Margin="16">
22+
<materialDesign:PackIcon Kind="StepForward" />
23+
</Button>
24+
</StackPanel>
25+
</StackPanel>
26+
</materialDesign:ColorZone>
27+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace MaterialDesignDemo.TransitionsDemo
17+
{
18+
/// <summary>
19+
/// Interaction logic for Slide3_Intro.xaml
20+
/// </summary>
21+
public partial class Slide3_Intro : UserControl
22+
{
23+
public Slide3_Intro()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)