Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Composition XAML Helpers #1567

Merged
merged 35 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0657511
initial work for connected and implicit animations
nmetulev Oct 16, 2017
0ab65d1
fixed conected animation bugs
nmetulev Oct 16, 2017
f51c2d0
renamed classes and added some documentation
nmetulev Oct 18, 2017
aebb96c
updated headers
nmetulev Oct 19, 2017
12cfb5a
Merge branch 'rel/2.0.1' into nmetulev/composition
nmetulev Oct 19, 2017
5b5da68
attempting back compat
nmetulev Oct 21, 2017
d524c85
Merge branch 'master' into nmetulev/composition
nmetulev Oct 22, 2017
44324ab
moved design helpers to UI project and made public
nmetulev Oct 22, 2017
fe65f2e
Added design time support for implicit animations
nmetulev Oct 22, 2017
5cdf2b2
added comments for implicit and connected animations
nmetulev Oct 22, 2017
100cbc7
added implicit animations sample page
nmetulev Oct 22, 2017
735d9a1
added sample page for connected animations
nmetulev Oct 23, 2017
a61c71c
added connected animations docs
nmetulev Oct 23, 2017
0dfe1b8
Started addeding composition animations docs
nmetulev Oct 23, 2017
ffca7e6
added more docs and sample page for visual extensions
nmetulev Oct 24, 2017
4b43777
updated headers
nmetulev Oct 24, 2017
9bdc359
updated icons to default helpers icon
nmetulev Oct 24, 2017
4f598a1
clean up
nmetulev Oct 24, 2017
d6b0d0c
updated dependency properties to use nameof
nmetulev Oct 25, 2017
0e5ad33
using weekreference in animationCollection and extending Ilist
nmetulev Oct 26, 2017
d5da85e
refactored connected animations to support multiple frames
nmetulev Oct 26, 2017
cabfd46
upfated with pr comments
nmetulev Oct 27, 2017
4176f82
fix for default value on TypedKeyFrame
nmetulev Oct 27, 2017
b13f26e
removed code from KeyFrames getter
nmetulev Oct 27, 2017
93da21c
added method to start animation through code and property to setting …
nmetulev Oct 30, 2017
8631f44
fixed merge conflict and pr comment
nmetulev Oct 30, 2017
8607b18
Merge branch 'master' into nmetulev/composition
nmetulev Oct 30, 2017
2147d51
docs - replaced xml code block with xaml
nmetulev Nov 1, 2017
1cee6a7
removed KeepCenterPointCentered and added NormalizedCenterPoint
nmetulev Nov 5, 2017
33aa6a1
Merge branch 'master' into nmetulev/composition
nmetulev Nov 6, 2017
89e2356
removed normalizedValue limits
nmetulev Nov 6, 2017
dfe73a2
changed documentation to LF endings
nmetulev Nov 8, 2017
16de99a
Merge branch 'master' into nmetulev/composition
nmetulev Nov 9, 2017
23787f4
code formatting fixes per pr review
nmetulev Nov 9, 2017
c938f45
code formatting fixed per pr review
nmetulev Nov 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
<Content Include="SamplePages\NetworkHelper\NetworkHelperCode.bind" />
<Content Include="SamplePages\PrintHelper\PrintHelperCode.bind" />
<Content Include="SamplePages\SystemInformation\SystemInformationCode.bind" />
<Content Include="SamplePages\DispatcherHelper\DispatcherHelperCode.bind" />
<Content Include="SamplePages\Connected Animations\ConnectedAnimationsCode.bind" />
<Content Include="SamplePages\ParallaxService\ParallaxPage.bind" />
<Content Include="SamplePages\Loading\LoadingCode.bind" />
<Content Include="SamplePages\ReorderGridAnimation\ReorderGrid.bind" />
Expand Down Expand Up @@ -433,7 +433,7 @@
<Content Include="SamplePages\Carousel\CarouselCode.bind" />
<Content Include="SamplePages\AlignmentGrid\AlignmentGridXaml.bind" />
<Content Include="SamplePages\FocusTracker\FocusTrackerXaml.bind" />
<Content Include="SamplePages\TextToolbar\TextToolbar.bind" />
<Content Include="SamplePages\Visual Extensions\VisualExtensionsCode.bind" />
<Content Include="SamplePages\TextToolbar\TextToolbarCode.bind" />
<Content Include="SamplePages\BluetoothLEHelper\BluetoothLEHelperCode.bind" />
<Content Include="SamplePages\OrbitView\OrbitViewXaml.bind" />
Expand All @@ -442,6 +442,9 @@
<Content Include="SamplePages\InAppNotification\InAppNotificationXaml.bind" />
<Content Include="SamplePages\ListViewBase\ListViewBaseCode.bind" />
<Content Include="SamplePages\PullToRefreshListView\PullToRefreshListViewXaml.bind" />
<Content Include="SamplePages\Implicit Animations\ImplicitAnimationsCode.bind" />
<Content Include="SamplePages\DispatcherHelper\DispatcherHelperCode.bind" />
<Content Include="SamplePages\TextToolbar\TextToolbar.bind" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
Expand Down Expand Up @@ -477,6 +480,21 @@
<DependentUpon>BluetoothLEHelperPage.xaml</DependentUpon>
</Compile>
<Compile Include="Common\IXamlRenderListener.cs" />
<Compile Include="SamplePages\Connected Animations\ConnectedAnimationsPage.xaml.cs">
<DependentUpon>ConnectedAnimationsPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Connected Animations\Pages\FirstPage.xaml.cs">
<DependentUpon>FirstPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Connected Animations\Pages\SecondPage.xaml.cs">
<DependentUpon>SecondPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Connected Animations\Pages\ThirdPage.xaml.cs">
<DependentUpon>ThirdPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Implicit Animations\ImplicitAnimationsPage.xaml.cs">
<DependentUpon>ImplicitAnimationsPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\InAppNotification\InAppNotificationPage.xaml.cs">
<DependentUpon>InAppNotificationPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -664,6 +682,9 @@
<DependentUpon>ImageExPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Twitter Service\TwitterTemplateSelector.cs" />
<Compile Include="SamplePages\Visual Extensions\VisualExtensionsPage.xaml.cs">
<DependentUpon>VisualExtensionsPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastPage.xaml.cs">
<DependentUpon>WeatherLiveTileAndToastPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -738,10 +759,30 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Connected Animations\ConnectedAnimationsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Connected Animations\Pages\FirstPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Connected Animations\Pages\SecondPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Connected Animations\Pages\ThirdPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\FocusTracker\FocusTrackerPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Implicit Animations\ImplicitAnimationsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\InAppNotification\InAppNotificationPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -950,6 +991,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Visual Extensions\VisualExtensionsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
2 changes: 2 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public string CodeUrl

public string XamlCodeFile { get; set; }

public bool DisableXamlEditorRendering { get; set; }

public string XamlCode { get; private set; }

public string DocumentationUrl { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!-- Frame -->

<Page ...
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations">

<!-- Page 1 -->
<Grid>
<Border Height="100"
Width="100"
Background="Purple"
VerticalAlignment="Center"
HorizontalAlignment="Center"
animations:Connected.Key="item"></Border>
</Grid>
<!-- /Page -->


<!-- Page 2 -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal">

<Border x:Name="HeroElement"
Height="300"
Width="300"
Background="Purple"
animations:Connected.Key="item"></Border>

<StackPanel x:Name="HeroDetailsElement"
Margin="20,0"
VerticalAlignment="Bottom"
MaxWidth="500"
animations:Connected.AnchorElement="{x:Bind HeroElement}">

<TextBlock Text="Header" FontSize="50"></TextBlock>
<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum ...</TextBlock>
</StackPanel>

</StackPanel>

<GridView x:Name="listView"
Margin="0, 40, 0, 0"
SelectionMode="None"
Grid.Row="1"
ItemClick="ListView_ItemClick"
IsItemClickEnabled="True"
animations:Connected.ListItemElementName="ItemThumbnail"
animations:Connected.ListItemKey="listItem">
<GridView.ItemTemplate>
<DataTemplate x:DataType="data:Item">
<StackPanel>
<Border x:Name="ItemThumbnail" Background="Purple" Height="200" Width="200"></Border>
<TextBlock Text="{x:Bind Title}"></TextBlock>
</StackPanel>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>

</Grid>
<!-- /Page -->


<!-- Page 3-->
<StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

<StackPanel x:Name="HeroDetailsElement"
Margin="20,0"
VerticalAlignment="Bottom"
MaxWidth="500"
animations:Connected.AnchorElement="{x:Bind ItemHeroElement}">

<TextBlock Text="{x:Bind item.Title}"
FontSize="50"></TextBlock>

<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum ...</TextBlock>

</StackPanel>

<Border x:Name="ItemHeroElement"
Height="300" Width="300"
Background="Purple"
animations:Connected.Key="listItem"></Border>
</StackPanel>

<TextBlock Margin="0,40"
TextWrapping="WrapWholeWords">Lorem Ipsum ...</TextBlock>
</StackPanel>
<!-- /Page -->

<!-- /Frame -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Page
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ConnectedAnimationsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Padding="40">

<Border BorderBrush="Gray" BorderThickness="1">

<Grid>

<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Background="{StaticResource SystemControlBackgroundAccentBrush}">
<StackPanel VerticalAlignment="Top" Orientation="Horizontal" Height="30">
<Button x:Name="BackButton" Click="BackButton_Click" Visibility="Collapsed" Foreground="White">Back</Button>
<TextBlock Margin="10,0" VerticalAlignment="Center" Foreground="White">My Connected Animations App
<animations:Implicit.Animations>
<animations:OffsetAnimation Duration="0:0:0.3"></animations:OffsetAnimation>
</animations:Implicit.Animations>
</TextBlock>
</StackPanel>
</Border>
<Frame Grid.Row="1" Navigated="Frame_Navigated" Navigating="RootFrame_Navigating" x:Name="RootFrame"></Frame>
</Grid>
</Border>

</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ConnectedAnimations.Pages;
using Microsoft.Toolkit.Uwp.UI.Animations;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class ConnectedAnimationsPage : Page
{
public ConnectedAnimationsPage()
{
this.InitializeComponent();
RootFrame.Navigate(typeof(FirstPage));
}

private void Frame_Navigated(object sender, NavigationEventArgs e)
{
BackButton.Visibility = RootFrame.CanGoBack ? Visibility.Visible : Visibility.Collapsed;
}

private void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
{
if (e.SourcePageType == RootFrame.SourcePageType)
{
e.Cancel = true;
}
}

private void BackButton_Click(object sender, RoutedEventArgs e)
{
RootFrame.GoBack();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Page
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ConnectedAnimations.Pages.FirstPage"
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:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Padding="20">

<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center">This is the first page, Click/Tap the box to navigate to the next page</TextBlock>

<Border Height="100"
Width="100"
Background="Purple"
VerticalAlignment="Center"
HorizontalAlignment="Center"
animations:Connected.Key="item"
Tapped="Border_Tapped"></Border>
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ConnectedAnimations.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class FirstPage : Page
{
public FirstPage()
{
this.InitializeComponent();
}

private void Border_Tapped(object sender, TappedRoutedEventArgs e)
{
Frame.Navigate(typeof(SecondPage));
}
}
}
Loading