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

Creating Microsoft.Toolkit.Uwp.UI.Behaviors #3634

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -112,9 +112,6 @@
<PackageReference Include="Microsoft.Services.Store.Engagement">
<Version>10.1901.28001</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Graph.Controls">
<Version>6.1.0-build.6</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.4.2</Version>
</PackageReference>
Expand Down Expand Up @@ -294,7 +291,6 @@
<Content Include="SamplePages\BackgroundTaskHelper\BackgroundTaskHelper.png" />
<Content Include="SamplePages\BluetoothLEHelper\BluetoothLEHelper.png" />
<Content Include="SamplePages\BackdropBlurBrush\BackdropBlurBrush.png" />
<Content Include="SamplePages\Blur\BlurBehavior.png" />
<Content Include="SamplePages\CameraPreview\CameraPreview.png" />
<Content Include="SamplePages\CameraHelper\CameraHelper.png" />
<Content Include="SamplePages\Connected Animations\ConnectedAnimations.png" />
Expand All @@ -303,7 +299,6 @@
<Content Include="SamplePages\DockPanel\DockPanel.png" />
<Content Include="SamplePages\LoginButton\LoginButton.png" />
<Content Include="SamplePages\FadeHeader\FadeHeaderBehavior.png" />
<Content Include="SamplePages\Fade\FadeBehavior.png" />
<Content Include="SamplePages\FocusTracker\FocusTracker.png" />
<Content Include="SamplePages\BladeView\BladeView.png" />
<Content Include="SamplePages\Carousel\Carousel.png" />
Expand All @@ -325,7 +320,6 @@
<Content Include="SamplePages\Incremental Loading Collection\icon.png" />
<Content Include="SamplePages\LayoutTransformControl\LayoutTransformControl.png" />
<Content Include="SamplePages\InfiniteCanvas\InfiniteCanvas.png" />
<Content Include="SamplePages\Light\LightBehavior.png" />
<Content Include="SamplePages\LinkedIn Service\LinkedInLogo.png" />
<Content Include="Assets\Helpers.png" />
<Content Include="SamplePages\LiveTile\LiveTile.png" />
Expand All @@ -336,18 +330,14 @@
<Content Include="SamplePages\Menu\Menu.png" />
<Content Include="SamplePages\Microsoft Translator Service\TranslatorService.png" />
<Content Include="SamplePages\NetworkHelper\NetworkHelper.png" />
<Content Include="SamplePages\Offset\OffsetBehavior.png" />
<Content Include="SamplePages\Mouse\MouseCursor.png" />
<Content Include="SamplePages\OneDrive Service\OneDriveLogo.png" />
<Content Include="SamplePages\RadialGauge\RadialGauge.png" />
<Content Include="SamplePages\RadialGradientBrush\RadialGradientBrush.png" />
<Content Include="SamplePages\RadialProgressBar\RadialProgressBar.png" />
<Content Include="SamplePages\RemoteDevicePicker\RemoteDevicePicker.png" />
<Content Include="SamplePages\ReorderGridAnimation\ReorderGrid.png" />
<Content Include="SamplePages\Rotate\RotateBehavior.png" />
<Content Include="SamplePages\Saturation\SaturationBehavior.png" />
<Content Include="SamplePages\OrbitView\OrbitView.png" />
<Content Include="SamplePages\Scale\ScaleBehavior.png" />
<Content Include="SamplePages\ScrollViewerExtensions\ScrollViewerExtensionsCode.bind" />
<Content Include="SamplePages\StaggeredPanel\StaggeredPanel.png" />
<Content Include="SamplePages\SystemInformation\SystemInformation.png" />
Expand Down Expand Up @@ -380,11 +370,7 @@
<Content Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToast.png" />
<Content Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastCode.bind" />
<Content Include="SamplePages\ImageEx\ImageExCode.bind" />
<Content Include="SamplePages\Offset\OffsetBehaviorCode.bind" />
<Content Include="SamplePages\Fade\FadeBehaviorCode.bind" />
<Content Include="SamplePages\RadialGauge\RadialGaugeCode.bind" />
<Content Include="SamplePages\Rotate\RotateBehaviorCode.bind" />
<Content Include="SamplePages\Scale\ScaleBehaviorCode.bind" />
<Content Include="Assets\Photos\Photos.json" />
<Content Include="Assets\Photos\OnlinePhotos.json" />
<Content Include="SamplePages\RangeSelector\RangeSelectorCode.bind" />
Expand All @@ -396,13 +382,7 @@
<Content Include="SamplePages\LiveTile\LiveTileCode.bind" />
<Content Include="SamplePages\Toast\ToastCode.bind" />
<Content Include="SamplePages\RotatorTile\RotatorTileCode.bind" />
<Content Include="SamplePages\Saturation\SaturationBehaviorCode.bind" />
<Content Include="SamplePages\Saturation\SaturationBehaviorXaml.bind" />
<Content Include="SamplePages\Offset\OffsetBehaviorXaml.bind" />
<Content Include="SamplePages\Expander\ExpanderXaml.bind" />
<Content Include="SamplePages\Fade\FadeBehaviorXaml.bind" />
<Content Include="SamplePages\Scale\ScaleBehaviorXaml.bind" />
<Content Include="SamplePages\Rotate\RotateBehaviorXaml.bind" />
<Content Include="SamplePages\BladeView\BladeCode.bind" />
<Content Include="SamplePages\ScrollHeader\ScrollHeaderCode.bind" />
<Content Include="SamplePages\GridSplitter\GridSplitter.bind" />
Expand All @@ -422,8 +402,6 @@
<Content Include="SamplePages\Connected Animations\ConnectedAnimationsCode.bind" />
<Content Include="SamplePages\Loading\LoadingCode.bind" />
<Content Include="SamplePages\ReorderGridAnimation\ReorderGrid.bind" />
<Content Include="SamplePages\Light\LightBehaviorCode.bind" />
<Content Include="SamplePages\Light\LightBehaviorXaml.bind" />
<Content Include="SamplePages\TextBoxMask\TextBoxMask.bind" />
<Content Include="SamplePages\TileControl\TileControl.bind">
<SubType>Designer</SubType>
Expand All @@ -440,8 +418,6 @@
<Content Include="SamplePages\TextBoxRegex\TextBoxRegex.bind" />
<Content Include="SamplePages\RadialProgressBar\RadialProgressBarCode.bind" />
<Content Include="SamplePages\MarkdownTextBlock\MarkdownTextBlockCode.bind" />
<Content Include="SamplePages\Blur\BlurBehaviorCode.bind" />
<Content Include="SamplePages\Blur\BlurBehaviorXaml.bind" />
<Content Include="SamplePages\ViewExtensions\ViewExtensionsCode.bind">
<SubType>Designer</SubType>
</Content>
Expand Down Expand Up @@ -832,9 +808,6 @@
<Compile Include="SamplePages\BladeView\BladePage.xaml.cs">
<DependentUpon>BladePage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Blur\BlurBehaviorPage.xaml.cs">
<DependentUpon>BlurBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\AlignmentGrid\AlignmentGridPage.xaml.cs">
<DependentUpon>AlignmentGridPage.xaml</DependentUpon>
</Compile>
Expand All @@ -844,9 +817,6 @@
<Compile Include="SamplePages\Microsoft Translator Service\MicrosoftTranslatorPage.xaml.cs">
<DependentUpon>MicrosoftTranslatorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Saturation\SaturationBehaviorPage.xaml.cs">
<DependentUpon>SaturationBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\TileControl\TileControlPage.xaml.cs">
<DependentUpon>TileControlPage.xaml</DependentUpon>
</Compile>
Expand All @@ -867,9 +837,6 @@
</Compile>
<Compile Include="SamplePages\Incremental Loading Collection\PeopleSource.cs" />
<Compile Include="SamplePages\Incremental Loading Collection\Person.cs" />
<Compile Include="SamplePages\Light\LightBehaviorPage.xaml.cs">
<DependentUpon>LightBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\LinkedIn Service\LinkedInPage.xaml.cs">
<DependentUpon>LinkedInPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -915,12 +882,6 @@
<Compile Include="SamplePages\Twitter Service\TwitterPage.xaml.cs">
<DependentUpon>TwitterPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Offset\OffsetBehaviorPage.xaml.cs">
<DependentUpon>OffsetBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Fade\FadeBehaviorPage.xaml.cs">
<DependentUpon>FadeBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\ImageEx\ImageExPage.xaml.cs">
<DependentUpon>ImageExPage.xaml</DependentUpon>
</Compile>
Expand All @@ -934,12 +895,6 @@
<Compile Include="SamplePages\WeatherLiveTileAndToast\WeatherLiveTileAndToastPage.xaml.cs">
<DependentUpon>WeatherLiveTileAndToastPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Rotate\RotateBehaviorPage.xaml.cs">
<DependentUpon>RotateBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\Scale\ScaleBehaviorPage.xaml.cs">
<DependentUpon>ScaleBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\RadialGauge\RadialGaugePage.xaml.cs">
<DependentUpon>RadialGaugePage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -1305,10 +1260,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Blur\BlurBehaviorPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\AlignmentGrid\AlignmentGridPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand All @@ -1325,10 +1276,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Saturation\SaturationBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\TileControl\TileControlPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -1357,10 +1304,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Light\LightBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\LinkedIn Service\LinkedInPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1393,14 +1336,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Offset\OffsetBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Fade\FadeBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Object Storage\ObjectStoragePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1453,14 +1388,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\Rotate\RotateBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Scale\ScaleBehaviorPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SamplePages\Weibo Service\WeiboPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1531,6 +1458,10 @@
<Project>{1ae2cb5c-58a0-4f12-8e6f-2cd4aaadb34c}</Project>
<Name>Microsoft.Toolkit.Uwp.Samples.BackgroundTasks</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj">
<Project>{d4ff799d-0df2-495a-adc9-3bbc4aef8971}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Behaviors</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid\Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.csproj">
<Project>{daeb9cec-c817-33b2-74b2-bc379380db72}</Project>
<Name>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid</Name>
Expand Down
22 changes: 10 additions & 12 deletions Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Toolkit.Graph.Converters;
using Microsoft.Toolkit.Graph.Providers;
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
using Microsoft.Toolkit.Uwp.SampleApp.Models;
Expand Down Expand Up @@ -658,16 +656,16 @@ private static Type LookForTypeByName(string typeName)
}

// Search in Microsoft.Toolkit.Graph.Controls
var graphControlsProxyType = typeof(UserToPersonConverter);
assembly = graphControlsProxyType.GetTypeInfo().Assembly;

foreach (var typeInfo in assembly.ExportedTypes)
{
if (typeInfo.Name == typeName)
{
return typeInfo;
}
}
//var graphControlsProxyType = typeof(UserToPersonConverter);
//assembly = graphControlsProxyType.GetTypeInfo().Assembly;

//foreach (var typeInfo in assembly.ExportedTypes)
//{
// if (typeInfo.Name == typeName)
// {
// return typeInfo;
// }
//}

// Search in Microsoft.Toolkit.Uwp.UI.Animations
var animationsProxyType = EasingType.Default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<!-- Shallow Copy -->
<Grid>
<ListView>
<interactivity:Interaction.Behaviors>
<behaviors:FadeHeaderBehavior />
</interactivity:Interaction.Behaviors>
</ListView>
</Grid>
<!-- Shallow Copy -->
<Grid />
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
mc:Ignorable="d">
<Grid>
<ListView x:Name="MyListView">
Expand All @@ -24,7 +24,7 @@
Margin="12" />
<TextBlock Text="It starts with 100% opacity but will fade to 0% as you scroll up."
Foreground="White"
Margin="12,0,12,12"
Margin="12,0,12,12"
VerticalAlignment="Center"
TextAlignment="Center" />
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Linq;
using Microsoft.Toolkit.Uwp.UI.Animations.Behaviors;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Microsoft.Xaml.Interactivity;
using Windows.UI.Xaml;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@
extensions:VisualExtensions.CenterPoint="50,50,0">

<animations:Implicit.ShowAnimations>
<animations:TranslationAnimation Duration="0:0:1" From="0, -200, 0" To="0" ></animations:TranslationAnimation>
<animations:OpacityAnimation Duration="0:0:1" From="0" To="1.0"></animations:OpacityAnimation>
<animations:TranslationAnimation Duration="0:0:1" From="0, -200, 0" To="0"/>
<animations:OpacityAnimation Duration="0:0:1" From="0" To="1.0"/>
</animations:Implicit.ShowAnimations>

<animations:Implicit.HideAnimations>
<animations:ScalarAnimation Target="Opacity" Duration="0:0:1" To="0.0"></animations:ScalarAnimation>
<animations:ScalarAnimation Target="Opacity" Duration="0:0:1" To="0.0"/>
<animations:ScalarAnimation Target="Translation.Y" Duration="0:0:1" To="-200">
<animations:ScalarKeyFrame Key="0.1" Value="30"></animations:ScalarKeyFrame>
<animations:ScalarKeyFrame Key="0.5" Value="0.0"></animations:ScalarKeyFrame>
<animations:ScalarKeyFrame Key="0.1" Value="30"/>
<animations:ScalarKeyFrame Key="0.5" Value="0.0"/>
</animations:ScalarAnimation>
</animations:Implicit.HideAnimations>

<animations:Implicit.Animations>
<animations:Vector3Animation Target="Offset" Duration="0:0:1"></animations:Vector3Animation>
<animations:Vector3Animation Target="Offset" Duration="0:0:1"/>
<animations:ScalarAnimation Target="RotationAngleInDegrees" ImplicitTarget="Offset" Duration="0:0:1.2" From="0" To="0">
<animations:ScalarKeyFrame Key="0.9" Value="80"></animations:ScalarKeyFrame>
<animations:ScalarKeyFrame Key="0.9" Value="80"/>
</animations:ScalarAnimation>
<animations:Vector3Animation Target="Scale" Duration="0:0:1"></animations:Vector3Animation>
<animations:Vector3Animation Target="Scale" Duration="0:0:1"/>
</animations:Implicit.Animations>

</Border>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.LoginButtonPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
xmlns:providers="using:Microsoft.Toolkit.Graph.Providers"
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
mc:Ignorable="d">

<Interactivity:Interaction.Behaviors>
<providers:MockProviderBehavior SignedIn="False"/>
<!--<providers:MockProviderBehavior SignedIn="False"/>-->
</Interactivity:Interaction.Behaviors>
<!-- Shallow Copy -->

<!-- Shallow Copy -->
<Grid>
<wgt:LoginButton/>
<!--<wgt:LoginButton />-->
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Linq;
using Microsoft.Toolkit.Uwp.UI.Animations.Behaviors;
using Microsoft.Toolkit.Uwp.UI.Extensions;
using Microsoft.Xaml.Interactivity;
using Windows.UI.Xaml;

namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
mc:Ignorable="d">
<Page.Resources>
<converters:EmptyObjectToObjectConverter x:Key="NullToVisibilityConverter" EmptyValue="Collapsed" NotEmptyValue="Visible"/>
<converters:EmptyObjectToObjectConverter x:Key="NullToVisibilityConverter"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
</Page.Resources>
<!-- Shallow Copy -->
<!-- Shallow Copy -->
<Grid>
<wgt:PeoplePicker/>
<!--<wgt:PeoplePicker/>-->
</Grid>
</Page>
Loading