Creating Microsoft.Toolkit.Uwp.UI.Behaviors
Removes ScrollHeader from the Controls Package Updates Sample pages to use Behaviors instead from new Behaviors package TODO/Broken: - Animation Behaviors Currently don't have a home (still in folder structure of Animations, most likely removed for new approach using Behaviors directly w/ new Animation System) - General Animation extensions removed (to be replaced with a new coordinated system) - Blur/Saturation Effect extensions don't have a home (to move to Media package?) - Sample App - Graph Control Samples (needs to be rebuilt with new Behaviors package) - ViewportBehavior Example (was using Blur Extension) - Re-apply Blur effect to the backgrounds in Shell.xaml as was using Behavior
This commit is contained in:
Родитель
37900247f0
Коммит
3362890824
|
@ -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>
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -336,7 +330,6 @@
|
|||
<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" />
|
||||
|
@ -344,10 +337,7 @@
|
|||
<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" />
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
|
|
@ -16,8 +16,6 @@ using System.Text.Json;
|
|||
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;
|
||||
|
@ -658,16 +656,16 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
}
|
||||
|
||||
// Search in Microsoft.Toolkit.Graph.Controls
|
||||
var graphControlsProxyType = typeof(UserToPersonConverter);
|
||||
assembly = graphControlsProxyType.GetTypeInfo().Assembly;
|
||||
//var graphControlsProxyType = typeof(UserToPersonConverter);
|
||||
//assembly = graphControlsProxyType.GetTypeInfo().Assembly;
|
||||
|
||||
foreach (var typeInfo in assembly.ExportedTypes)
|
||||
{
|
||||
if (typeInfo.Name == typeName)
|
||||
{
|
||||
return typeInfo;
|
||||
}
|
||||
}
|
||||
//foreach (var typeInfo in assembly.ExportedTypes)
|
||||
//{
|
||||
// if (typeInfo.Name == typeName)
|
||||
// {
|
||||
// return typeInfo;
|
||||
// }
|
||||
//}
|
||||
|
||||
// Search in Microsoft.Toolkit.Uwp.UI.Animations
|
||||
var animationsProxyType = EasingType.Default;
|
||||
|
|
|
@ -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>
|
|
@ -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">
|
||||
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
|
||||
mc:Ignorable="d">
|
||||
<!-- Shallow Copy -->
|
||||
<!-- Shallow Copy -->
|
||||
<Grid>
|
||||
<wgt:PersonView/>
|
||||
<!--<wgt:PersonView/>-->
|
||||
</Grid>
|
||||
</Page>
|
||||
|
|
|
@ -2,34 +2,37 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:models="using:Microsoft.Toolkit.Uwp.SampleApp.Models"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<ListView Name="listView">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<behaviors:QuickReturnHeaderBehavior />
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<ListView.Header>
|
||||
<controls:ScrollHeader Mode="@[Mode:Enum:ScrollHeaderMode.QuickReturn]">
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
MinHeight="250"
|
||||
Background="{ThemeResource Brush-Blue-01}">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
Text="The scroll header supports quick return, sticky and fade behavior. If fade is enabled the header fades out while scrolling down. If quick return is enabled the header hides when the ListView is scrolled down and reappears immediately as soon as the ListView is scrolled up again. If sticky is enabled the header is displayed regardless of scrolling."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</controls:ScrollHeader>
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
MinHeight="250"
|
||||
Background="{ThemeResource Brush-Blue-01}">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="White"
|
||||
Text="The scroll header supports quick return, sticky and fade behavior. If fade is enabled the header fades out while scrolling down. If quick return is enabled the header hides when the ListView is scrolled down and reappears immediately as soon as the ListView is scrolled up again. If sticky is enabled the header is displayed regardless of scrolling."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ListView.Header>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ScrollHeaderPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<!-- Shallow Copy -->
|
||||
<Grid Visibility="Collapsed">
|
||||
<ListView>
|
||||
<ListView.Header>
|
||||
<controls:ScrollHeader>
|
||||
<Grid/>
|
||||
</controls:ScrollHeader>
|
||||
</ListView.Header>
|
||||
</ListView>
|
||||
</Grid>
|
||||
<!-- Shallow Copy -->
|
||||
<Page.Resources>
|
||||
<behaviors:QuickReturnHeaderBehavior x:Key="QuickReturnHeaderBehavior" />
|
||||
<behaviors:StickyHeaderBehavior x:Key="StickyHeaderBehavior" />
|
||||
<behaviors:FadeHeaderBehavior x:Key="FadeHeaderBehavior" />
|
||||
</Page.Resources>
|
||||
</Page>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ScrollViewerExtensionsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
xmlns:common="using:Microsoft.Toolkit.Uwp.SampleApp.Common"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ScrollViewerExtensionsPage"
|
||||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
@ -14,47 +16,49 @@
|
|||
|
||||
<Grid>
|
||||
<ListView Name="listView"
|
||||
extensions:ScrollViewerExtensions.VerticalScrollBarMargin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}">
|
||||
extensions:ScrollViewerExtensions.VerticalScrollBarMargin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<behaviors:StickyHeaderBehavior />
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<ListView.Header>
|
||||
<controls:ScrollHeader Mode="Sticky">
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
Background="{ThemeResource Brush-Sample-TransparentHeader}">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="The attached property allows you to assign a Thickness to both vertical and horizontal ScrollBar inside any container. In this example, VerticalScrollBarMargin is bound to StickyHeader's MinHeight. Moving MinHeight's Slider will move the vertical ScrollBar accordingly."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</controls:ScrollHeader>
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
Background="{ThemeResource Brush-Sample-TransparentHeader}">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="The attached property allows you to assign a Thickness to both vertical and horizontal ScrollBar inside any container. In this example, VerticalScrollBarMargin is bound to StickyHeader's MinHeight. Moving MinHeight's Slider will move the vertical ScrollBar accordingly."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ListView.Header>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid MinHeight="100" Background="Blue">
|
||||
<Grid MinHeight="100"
|
||||
Background="Blue">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ToolkitLogo"
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="0,0,24,0"
|
||||
Source="ms-appx:///Assets/ToolkitLogo.png" />
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="0,0,24,0"
|
||||
Source="ms-appx:///Assets/ToolkitLogo.png" />
|
||||
<TextBlock Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
@ -66,45 +70,44 @@
|
|||
</ListView.ItemContainerStyle>
|
||||
</ListView>
|
||||
<StackPanel x:Name="shapesPanel"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
|
||||
Padding="88"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="32">
|
||||
<Polygon Height="100"
|
||||
Width="100"
|
||||
Points="0,0 0,72 44,36"
|
||||
Stroke="DarkGreen"
|
||||
<Polygon Width="100"
|
||||
Height="100"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Fill="Green"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Spacing="4"
|
||||
Points="0,0 0,72 44,36"
|
||||
Stroke="DarkGreen" />
|
||||
<StackPanel Width="100"
|
||||
Height="84"
|
||||
Width="100">
|
||||
<Polygon Points="0,0 0,56 32,28"
|
||||
Stroke="Blue"
|
||||
Fill="DodgerBlue"/>
|
||||
<Polygon Points="0,0 0,56 32,28"
|
||||
Stroke="Blue"
|
||||
Fill="DodgerBlue"/>
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Spacing="4">
|
||||
<Polygon Fill="DodgerBlue"
|
||||
Points="0,0 0,56 32,28"
|
||||
Stroke="Blue" />
|
||||
<Polygon Fill="DodgerBlue"
|
||||
Points="0,0 0,56 32,28"
|
||||
Stroke="Blue" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Height="100"
|
||||
FontSize="24"
|
||||
TextAlignment="Center">
|
||||
<Run Text="Look at me, I'm floating between"/>
|
||||
<LineBreak/>
|
||||
<Run Text="two different ListView items!"/>
|
||||
<TextBlock Height="100"
|
||||
FontSize="24"
|
||||
TextAlignment="Center">
|
||||
<Run Text="Look at me, I'm floating between" />
|
||||
<LineBreak />
|
||||
<Run Text="two different ListView items!" />
|
||||
</TextBlock>
|
||||
<Polygon Height="100"
|
||||
Width="100"
|
||||
Points="0,0 0,60 60,60 60,0"
|
||||
Stroke="DarkRed"
|
||||
Fill="Crimson"
|
||||
<Polygon Width="100"
|
||||
Height="100"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"/>
|
||||
Fill="Crimson"
|
||||
Points="0,0 0,60 60,60 60,0"
|
||||
Stroke="DarkRed" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -5,6 +5,8 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
|
@ -15,29 +17,30 @@
|
|||
<ListView Name="listView"
|
||||
extensions:ScrollViewerExtensions.VerticalScrollBarMargin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
|
||||
extensions:ScrollViewerExtensions.EnableMiddleClickScrolling="@[EnableMiddleClickScrolling:Bool:True]">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<behaviors:StickyHeaderBehavior />
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<ListView.Header>
|
||||
<controls:ScrollHeader Mode="Sticky">
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
MinHeight="@[Header MinHeight:DoubleSlider:250:150-500]"
|
||||
Background="{ThemeResource Brush-Sample-TransparentHeader}">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="The attached property allows you to assign a Thickness to both vertical and horizontal ScrollBar inside any container. In this example, VerticalScrollBarMargin is bound to StickyHeader's MinHeight. Moving MinHeight's Slider will move the vertical ScrollBar accordingly."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</controls:ScrollHeader>
|
||||
<Grid x:Name="MyHeaderGrid"
|
||||
MinHeight="@[Header MinHeight:DoubleSlider:250:150-500]"
|
||||
Background="{ThemeResource Brush-Sample-TransparentHeader}">
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Margin="12"
|
||||
FontSize="48"
|
||||
FontWeight="Bold"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="Scroll Header"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Margin="12,0,12,12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="The attached property allows you to assign a Thickness to both vertical and horizontal ScrollBar inside any container. In this example, VerticalScrollBarMargin is bound to StickyHeader's MinHeight. Moving MinHeight's Slider will move the vertical ScrollBar accordingly."
|
||||
TextAlignment="Center"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ListView.Header>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
if (control.FindChildByName("EffectElement") is Image effectElement)
|
||||
{
|
||||
_effectElement = effectElement;
|
||||
_effectElement.Blur(value: 10, duration: 0).Start();
|
||||
////TODO: _effectElement.Blur(value: 10, duration: 0).Start();
|
||||
}
|
||||
|
||||
if (control.FindChildByName("EffectElementHost") is FrameworkElement effectElementHost)
|
||||
|
@ -72,7 +72,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
{
|
||||
AddLog("Entered viewport");
|
||||
|
||||
await _effectElement.Blur(value: 0, duration: 1500).StartAsync();
|
||||
////TODO: await _effectElement.Blur(value: 0, duration: 1500).StartAsync();
|
||||
}
|
||||
|
||||
private void EffectElementHost_EnteringViewport(object sender, EventArgs e)
|
||||
|
@ -87,7 +87,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
AddLog("Exited viewport");
|
||||
|
||||
_effectElement.Source = null;
|
||||
await _effectElement.Blur(value: 8, duration: 0).StartAsync();
|
||||
////TODO: await _effectElement.Blur(value: 8, duration: 0).StartAsync();
|
||||
}
|
||||
|
||||
private void EffectElementHost_ExitingViewport(object sender, EventArgs e)
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.Shell"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Animations.Behaviors"
|
||||
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
||||
extensions:TitleBarExtensions.BackgroundColor="{StaticResource Brand-Color}"
|
||||
extensions:TitleBarExtensions.ButtonBackgroundColor="{StaticResource Brand-Color}"
|
||||
extensions:TitleBarExtensions.ButtonForegroundColor="{StaticResource Titlebar-Foreground}"
|
||||
|
@ -30,58 +30,62 @@
|
|||
</Page.Resources>
|
||||
<Grid>
|
||||
<winui:NavigationView x:Name="NavView"
|
||||
Style="{StaticResource ToolkitNavViewStyle}"
|
||||
PaneDisplayMode="Top"
|
||||
MenuItemTemplate="{StaticResource CategoryTemplate}"
|
||||
IsSettingsVisible="True"
|
||||
ItemInvoked="NavView_ItemInvoked"
|
||||
MenuItemTemplate="{StaticResource CategoryTemplate}"
|
||||
PaneDisplayMode="Top"
|
||||
SelectionFollowsFocus="Disabled"
|
||||
IsSettingsVisible="True">
|
||||
Style="{StaticResource ToolkitNavViewStyle}">
|
||||
<winui:NavigationView.PaneFooter>
|
||||
<AutoSuggestBox x:Name="SearchBox"
|
||||
VerticalAlignment="Center"
|
||||
MinWidth="150"
|
||||
QueryIcon="Find"
|
||||
TextChanged="SearchBox_TextChanged"
|
||||
VerticalAlignment="Center"
|
||||
KeyDown="SearchBox_KeyDown"
|
||||
QuerySubmitted="SearchBox_QuerySubmitted" />
|
||||
QueryIcon="Find"
|
||||
QuerySubmitted="SearchBox_QuerySubmitted"
|
||||
TextChanged="SearchBox_TextChanged" />
|
||||
</winui:NavigationView.PaneFooter>
|
||||
<Grid>
|
||||
<winui:ParallaxView x:Name="Parallax"
|
||||
VerticalShift="50">
|
||||
<Image Stretch="UniformToFill"
|
||||
Source="Assets/Photos/Backgrounds/hero.jpg"/>
|
||||
<Image Source="Assets/Photos/Backgrounds/hero.jpg"
|
||||
Stretch="UniformToFill" />
|
||||
</winui:ParallaxView>
|
||||
<Frame x:Name="NavigationFrame" />
|
||||
<Grid>
|
||||
<Border x:Name="ContentShadow"
|
||||
Tapped="ContentShadow_Tapped"
|
||||
Background="{ThemeResource BackingTint}"
|
||||
Tapped="ContentShadow_Tapped"
|
||||
Visibility="{Binding Visibility, ElementName=SamplePickerGrid}">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<behaviors:Blur AutomaticallyStart="True"
|
||||
<!--TODO: BackdropBlurBrush? <behaviors:Blur AutomaticallyStart="True"
|
||||
Delay="0"
|
||||
Value="2"
|
||||
Duration="0" />
|
||||
Duration="0" />-->
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3"></animations:OpacityAnimation>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.2"></animations:OpacityAnimation>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.2" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Border>
|
||||
|
||||
<Grid x:Name="SamplePickerGrid"
|
||||
VerticalAlignment="Top"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Visibility="Collapsed"
|
||||
VerticalAlignment="Top">
|
||||
<controls:DropShadowPanel VerticalContentAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ShadowOpacity="0.7"
|
||||
Color="Black"
|
||||
BlurRadius="10"
|
||||
Visibility="Collapsed">
|
||||
<controls:DropShadowPanel Margin="0,0,0,-3"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="0,0,0,-3">
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
BlurRadius="10"
|
||||
ShadowOpacity="0.7"
|
||||
Color="Black">
|
||||
<Border Height="1" />
|
||||
</controls:DropShadowPanel>
|
||||
|
||||
|
@ -89,35 +93,47 @@
|
|||
|
||||
<GridView x:Name="SamplePickerGridView"
|
||||
animations:ReorderGridAnimation.Duration="200"
|
||||
ChoosingItemContainer="SamplePickerGridView_ChoosingItemContainer"
|
||||
IsItemClickEnabled="True"
|
||||
ItemClick="SamplePickerGridView_ItemClick"
|
||||
ItemContainerStyle="{StaticResource SamplePickerItemStyle}"
|
||||
ItemContainerTransitions="{x:Null}"
|
||||
ItemTemplate="{StaticResource SampleTemplate}"
|
||||
SelectionMode="Single"
|
||||
ItemClick="SamplePickerGridView_ItemClick"
|
||||
ChoosingItemContainer="SamplePickerGridView_ChoosingItemContainer"
|
||||
Transitions="{x:Null}">
|
||||
<GridView.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Key}"/>
|
||||
<TextBlock Text="{Binding Key}" />
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</GridView.GroupStyle>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3" Delay="0:0:0.2" SetInitialValueBeforeDelay="True"></animations:OpacityAnimation>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</GridView>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3"></animations:OpacityAnimation>
|
||||
<animations:TranslationAnimation From="0, -1000, 0" To="0" Duration="0:0:0.3"></animations:TranslationAnimation>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:TranslationAnimation From="0, -1000, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation From="1" To="0" Duration="0:0:0.5"></animations:OpacityAnimation>
|
||||
<animations:TranslationAnimation To="0, -1000, 0" From="0" Duration="0:0:0.5"></animations:TranslationAnimation>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.5" />
|
||||
<animations:TranslationAnimation From="0"
|
||||
To="0, -1000, 0"
|
||||
Duration="0:0:0.5" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Grid>
|
||||
|
||||
|
@ -125,30 +141,30 @@
|
|||
</Grid>
|
||||
</winui:NavigationView>
|
||||
<Canvas x:Name="MoreInfoCanvas"
|
||||
Grid.RowSpan="2"
|
||||
Background="Transparent"
|
||||
Tapped="MoreInfoCanvas_Tapped"
|
||||
Visibility="Collapsed"
|
||||
Grid.RowSpan="2">
|
||||
Visibility="Collapsed">
|
||||
|
||||
<Grid x:Name="MoreInfoContent"
|
||||
Width="260"
|
||||
Height="320"
|
||||
extensions:VisualExtensions.NormalizedCenterPoint="0.5">
|
||||
<Grid VerticalAlignment="Top">
|
||||
<controls:DropShadowPanel VerticalContentAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ShadowOpacity="0.6"
|
||||
Color="Black"
|
||||
<controls:DropShadowPanel HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
BlurRadius="60"
|
||||
OffsetY="6"
|
||||
BlurRadius="60">
|
||||
ShadowOpacity="0.6"
|
||||
Color="Black">
|
||||
<Border Background="{ThemeResource Menu-DropDown-Background}"
|
||||
Opacity="0.96">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<!-- TODO: BackdropBlurBrush? <interactivity:Interaction.Behaviors>
|
||||
<behaviors:Blur AutomaticallyStart="True"
|
||||
Delay="0"
|
||||
Value="3"
|
||||
Duration="0" />
|
||||
</interactivity:Interaction.Behaviors>
|
||||
</interactivity:Interaction.Behaviors>-->
|
||||
</Border>
|
||||
</controls:DropShadowPanel>
|
||||
|
||||
|
@ -160,58 +176,81 @@
|
|||
|
||||
<Grid Grid.Row="0"
|
||||
Background="{ThemeResource SampleIconBacking}">
|
||||
<Image Width="240"
|
||||
x:Name="MoreInfoImage"
|
||||
<Image x:Name="MoreInfoImage"
|
||||
Width="240"
|
||||
Height="160"
|
||||
Source="{Binding Icon}" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<TextBlock Margin="0, 10"
|
||||
<TextBlock Margin="0,10"
|
||||
FontSize="14"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
|
||||
<TextBlock FontSize="12"
|
||||
Text="{Binding About}"
|
||||
TextWrapping="Wrap" />
|
||||
Text="{Binding About}"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<Border Margin="0,10,0,0"
|
||||
Opacity="1"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{StaticResource Brush-Blue-01}"
|
||||
Opacity="1"
|
||||
Visibility="{Binding BadgeUpdateVersionRequired, Converter={StaticResource EmptyStringToObject}}">
|
||||
<TextBlock Margin="2"
|
||||
FontSize="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
FontSize="10"
|
||||
Foreground="{ThemeResource Brush-Main}"
|
||||
Text="{Binding BadgeUpdateVersionRequired}" />
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation To="0" Duration="0:0:0.01"></animations:OpacityAnimation>
|
||||
<animations:OpacityAnimation To="0"
|
||||
Duration="0:0:0.01" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.4" Delay="0:0:0.2" SetInitialValueBeforeDelay="True"></animations:OpacityAnimation>
|
||||
<animations:TranslationAnimation From="0, 20, 0" To="0" Duration="0:0:0.3" Delay="0:0:0.2"></animations:TranslationAnimation>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2"
|
||||
From="0, 20, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</Border>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.4" Delay="0:0:0.2" SetInitialValueBeforeDelay="True"></animations:OpacityAnimation>
|
||||
<animations:TranslationAnimation From="0, 20, 0" To="0" Duration="0:0:0.3" Delay="0:0:0.2"></animations:TranslationAnimation>
|
||||
<animations:OpacityAnimation Delay="0:0:0.2"
|
||||
SetInitialValueBeforeDelay="True"
|
||||
From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.4" />
|
||||
<animations:TranslationAnimation Delay="0:0:0.2"
|
||||
From="0, 20, 0"
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<animations:Implicit.ShowAnimations>
|
||||
<animations:OpacityAnimation From="0" To="1" Duration="0:0:0.3"></animations:OpacityAnimation>
|
||||
<animations:ScaleAnimation From="0.5" To="1" Duration="0:0:0.3"></animations:ScaleAnimation>
|
||||
<animations:OpacityAnimation From="0"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
<animations:ScaleAnimation From="0.5"
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
</animations:Implicit.ShowAnimations>
|
||||
<animations:Implicit.HideAnimations>
|
||||
<animations:OpacityAnimation To="0" From="1" Duration="0:0:0.2"></animations:OpacityAnimation>
|
||||
<animations:ScaleAnimation To="0.5" From="1" Duration="0:0:0.2"></animations:ScaleAnimation>
|
||||
<animations:OpacityAnimation From="1"
|
||||
To="0"
|
||||
Duration="0:0:0.2" />
|
||||
<animations:ScaleAnimation From="1"
|
||||
To="0.5"
|
||||
Duration="0:0:0.2" />
|
||||
</animations:Implicit.HideAnimations>
|
||||
</Grid>
|
||||
</Canvas>
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:CustomPivotHeaderItem">
|
||||
<Style x:Name="PivotHeaderItemUnderlineStyle" TargetType="PivotHeaderItem">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:CustomPivotHeaderItem">
|
||||
<Style x:Name="PivotHeaderItemUnderlineStyle"
|
||||
TargetType="PivotHeaderItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="PivotHeaderItem">
|
||||
<Grid x:Name="Grid" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
|
||||
<Grid x:Name="Grid"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Grid.Resources>
|
||||
<Style x:Key="BaseContentPresenterStyle" TargetType="ContentPresenter">
|
||||
<Style x:Key="BaseContentPresenterStyle"
|
||||
TargetType="ContentPresenter">
|
||||
<Setter Property="FontFamily" Value="XamlAutoFontFamily" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
|
@ -17,25 +20,58 @@
|
|||
<Setter Property="TextLineBounds" Value="Full" />
|
||||
<Setter Property="OpticalMarginAlignment" Value="TrimSideBearings" />
|
||||
</Style>
|
||||
<Style x:Key="BodyContentPresenterStyle" TargetType="ContentPresenter" BasedOn="{StaticResource BaseContentPresenterStyle}">
|
||||
<Style x:Key="BodyContentPresenterStyle"
|
||||
BasedOn="{StaticResource BaseContentPresenterStyle}"
|
||||
TargetType="ContentPresenter">
|
||||
<Setter Property="FontFamily" Value="{ThemeResource PivotHeaderItemFontFamily}" />
|
||||
<Setter Property="FontWeight" Value="{ThemeResource PivotHeaderItemThemeFontWeight}" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource PivotHeaderItemFontSize}" />
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform x:Name="ContentPresenterTranslateTransform" />
|
||||
</Grid.RenderTransform>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
<Rectangle x:Name="FocusPipe"
|
||||
Height="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
Fill="{ThemeResource PivotHeaderItemFocusPipeFill}"
|
||||
Visibility="Collapsed" />
|
||||
<Rectangle x:Name="UnderScore"
|
||||
Height="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
Fill="{ThemeResource SystemControlForegroundBaseHighBrush}"
|
||||
Visibility="Collapsed" />
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="Unselected" To="UnselectedLocked" GeneratedDuration="0:0:0.33" />
|
||||
<VisualTransition From="UnselectedLocked" To="Unselected" GeneratedDuration="0:0:0.33" />
|
||||
<VisualTransition GeneratedDuration="0:0:0.33"
|
||||
From="Unselected"
|
||||
To="UnselectedLocked" />
|
||||
<VisualTransition GeneratedDuration="0:0:0.33"
|
||||
From="UnselectedLocked"
|
||||
To="Unselected" />
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemForegroundDisabled}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemForegroundDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundDisabled}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundDisabled}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
@ -43,71 +79,97 @@
|
|||
<VisualState x:Name="UnselectedLocked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="ContentPresenterTranslateTransform"
|
||||
Storyboard.TargetProperty="X"
|
||||
Duration="0"
|
||||
To="{ThemeResource PivotHeaderItemLockedTranslation}" />
|
||||
Storyboard.TargetProperty="X"
|
||||
To="{ThemeResource PivotHeaderItemLockedTranslation}"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)"
|
||||
Duration="0"
|
||||
To="0" />
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)"
|
||||
To="0"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemBaseHighColor}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemBaseHighColor}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundSelected}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundSelected}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="UnselectedPointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemForegroundUnselectedPointerOver}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemForegroundUnselectedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundUnselectedPointerOver}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundUnselectedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemBaseMediumColor}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemBaseMediumColor}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundSelectedPointerOver}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundSelectedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="UnselectedPressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemForegroundUnselectedPressed}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemForegroundUnselectedPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundUnselectedPressed}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundUnselectedPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemBaseMediumHighColor}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemBaseMediumHighColor}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotHeaderItemBackgroundSelectedPressed}" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource PivotHeaderItemBackgroundSelectedPressed}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnderScore"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
@ -121,25 +183,6 @@
|
|||
<VisualState x:Name="Unfocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform x:Name="ContentPresenterTranslateTransform" />
|
||||
</Grid.RenderTransform>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
<Rectangle x:Name="FocusPipe"
|
||||
Fill="{ThemeResource PivotHeaderItemFocusPipeFill}"
|
||||
Height="2"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Stretch"
|
||||
Visibility="Collapsed" />
|
||||
<Rectangle x:Name="UnderScore" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom" Height="2" Visibility="Collapsed" Fill="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
|
|
@ -7,22 +7,34 @@
|
|||
This library provides helpers and extensions on top of Windows Composition and XAML storyboards. It is part of the Windows Community Toolkit.
|
||||
|
||||
Namespace:
|
||||
- Behaviors: Blur, CompositionBehaviorBase, CompositionBehaviorBase, Fade, FadeHeaderBehavior, Light, Offset, QuickReturnHeaderBehavior, Rotate, Saturation, Scale, StickyHeaderBehavior.
|
||||
- CompositionAnimations:
|
||||
- Animations: AnimationBase, OffsetAnimation, OpacityAnimation, RotationAnimation, RotationInDegreesAnimation, ScalarAnimation, ScaleAnimation, TranslationAnimation, TypedAnimationBase, Vector2Animation, Vector3Animation, Vector4Animation
|
||||
- CompositionAnimations: ExpressionKeyFrame, KeyFrame, KeyFrameCollection, ScalarKeyFrame, TypedKeyFrame, Vector2KeyFrame, Vector3KeyFrame, Vector4KeyFrame
|
||||
- ConnectedAnimations: Connected, ConnectedAnimationHelper, ConnectedAnimationListProperty, ConnectedAnimationProperties
|
||||
- Effects: AnimationEffect, Blur, Saturation
|
||||
- Expressions: ExpressionNodes, ExpressionValues, ReferenceNodes, CompositionExtensions, ExpressionFunctions, OperationType
|
||||
- AnimationExtensions: Blur, Fade, Light, Offset, Rotate, Saturation, Scale
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Animations Composition Connected Implicit XAML</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- TODO: Figure out where these go... -->
|
||||
<ItemGroup>
|
||||
<Compile Remove="Behaviors\**" />
|
||||
<Compile Remove="Effects\**" />
|
||||
<Compile Remove="Extensions\**" />
|
||||
<EmbeddedResource Remove="Behaviors\**" />
|
||||
<EmbeddedResource Remove="Effects\**" />
|
||||
<EmbeddedResource Remove="Extensions\**" />
|
||||
<None Remove="Behaviors\**" />
|
||||
<None Remove="Effects\**" />
|
||||
<None Remove="Extensions\**" />
|
||||
<Page Remove="Behaviors\**" />
|
||||
<Page Remove="Effects\**" />
|
||||
<Page Remove="Extensions\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
|
||||
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,190 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// 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;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.Text;
|
||||
using Microsoft.Graphics.Canvas.UI.Composition;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Metadata;
|
||||
using Windows.Graphics.DirectX;
|
||||
using Windows.UI;
|
||||
using Windows.UI.Composition;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegate for load time effects.
|
||||
/// </summary>
|
||||
/// <param name="bitmap">The bitmap.</param>
|
||||
/// <param name="device">The device.</param>
|
||||
/// <param name="sizeTarget">The size target.</param>
|
||||
/// <returns>A CompositeDrawingSurface</returns>
|
||||
public delegate CompositionDrawingSurface LoadTimeEffectHandler(CanvasBitmap bitmap, CompositionGraphicsDevice device, Size sizeTarget);
|
||||
|
||||
/// <summary>
|
||||
/// The SurfaceLoader is responsible to loading images into Composition Objects.
|
||||
/// </summary>
|
||||
[Deprecated("This class is deprecated, please use the SurfaceLoader class from the Microsoft.Toolkit.Uwp.UI.Media package.", DeprecationType.Deprecate, 6)]
|
||||
public class SurfaceLoader
|
||||
{
|
||||
/// <summary>
|
||||
/// A flag to store the initialized state.
|
||||
/// </summary>
|
||||
private static bool _intialized;
|
||||
|
||||
/// <summary>
|
||||
/// The compositor
|
||||
/// </summary>
|
||||
private static Compositor _compositor;
|
||||
|
||||
/// <summary>
|
||||
/// The canvas device
|
||||
/// </summary>
|
||||
private static CanvasDevice _canvasDevice;
|
||||
|
||||
/// <summary>
|
||||
/// The composition graphic device to determine which GPU is handling the request.
|
||||
/// </summary>
|
||||
private static CompositionGraphicsDevice _compositionDevice;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the specified compositor.
|
||||
/// </summary>
|
||||
/// <param name="compositor">The compositor.</param>
|
||||
public static void Initialize(Compositor compositor)
|
||||
{
|
||||
if (!_intialized)
|
||||
{
|
||||
_compositor = compositor;
|
||||
_canvasDevice = new CanvasDevice();
|
||||
_compositionDevice = CanvasComposition.CreateCompositionGraphicsDevice(_compositor, _canvasDevice);
|
||||
|
||||
_intialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uninitializes this instance.
|
||||
/// </summary>
|
||||
public static void Uninitialize()
|
||||
{
|
||||
_compositor = null;
|
||||
|
||||
if (_compositionDevice != null)
|
||||
{
|
||||
_compositionDevice.Dispose();
|
||||
_compositionDevice = null;
|
||||
}
|
||||
|
||||
if (_canvasDevice != null)
|
||||
{
|
||||
_canvasDevice.Dispose();
|
||||
_canvasDevice = null;
|
||||
}
|
||||
|
||||
_intialized = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is initialized.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if this instance is initialized; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public static bool IsInitialized
|
||||
{
|
||||
get
|
||||
{
|
||||
return _intialized;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads an image from the URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The URI.</param>
|
||||
/// <returns><see cref="CompositionDrawingSurface"/></returns>
|
||||
public static async Task<CompositionDrawingSurface> LoadFromUri(Uri uri)
|
||||
{
|
||||
return await LoadFromUri(uri, Size.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads an image from URI with a specified size.
|
||||
/// </summary>
|
||||
/// <param name="uri">The URI.</param>
|
||||
/// <param name="sizeTarget">The size target.</param>
|
||||
/// <returns><see cref="CompositionDrawingSurface"/></returns>
|
||||
public static async Task<CompositionDrawingSurface> LoadFromUri(Uri uri, Size sizeTarget)
|
||||
{
|
||||
CanvasBitmap bitmap = await CanvasBitmap.LoadAsync(_canvasDevice, uri);
|
||||
Size sizeSource = bitmap.Size;
|
||||
|
||||
if (sizeTarget.IsEmpty)
|
||||
{
|
||||
sizeTarget = sizeSource;
|
||||
}
|
||||
|
||||
CompositionDrawingSurface surface = _compositionDevice.CreateDrawingSurface(
|
||||
sizeTarget,
|
||||
DirectXPixelFormat.B8G8R8A8UIntNormalized,
|
||||
DirectXAlphaMode.Premultiplied);
|
||||
|
||||
using (var ds = CanvasComposition.CreateDrawingSession(surface))
|
||||
{
|
||||
ds.Clear(Color.FromArgb(0, 0, 0, 0));
|
||||
ds.DrawImage(bitmap, new Rect(0, 0, sizeTarget.Width, sizeTarget.Height), new Rect(0, 0, sizeSource.Width, sizeSource.Height));
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the text on to a <see cref="CompositionDrawingSurface"/>.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="sizeTarget">The size target.</param>
|
||||
/// <param name="textFormat">The text format.</param>
|
||||
/// <param name="textColor">Color of the text.</param>
|
||||
/// <param name="bgColor">Color of the bg.</param>
|
||||
/// <returns><see cref="CompositionDrawingSurface"/></returns>
|
||||
public static CompositionDrawingSurface LoadText(string text, Size sizeTarget, CanvasTextFormat textFormat, Color textColor, Color bgColor)
|
||||
{
|
||||
CompositionDrawingSurface surface = _compositionDevice.CreateDrawingSurface(
|
||||
sizeTarget,
|
||||
DirectXPixelFormat.B8G8R8A8UIntNormalized,
|
||||
DirectXAlphaMode.Premultiplied);
|
||||
|
||||
using (var ds = CanvasComposition.CreateDrawingSession(surface))
|
||||
{
|
||||
ds.Clear(bgColor);
|
||||
ds.DrawText(text, new Rect(0, 0, sizeTarget.Width, sizeTarget.Height), textColor, textFormat);
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads an image from URI, with a specified size.
|
||||
/// </summary>
|
||||
/// <param name="uri">The URI.</param>
|
||||
/// <param name="sizeTarget">The size target.</param>
|
||||
/// <param name="loadEffectHandler">The load effect handler callback.</param>
|
||||
/// <returns><see cref="CompositionDrawingSurface"/></returns>
|
||||
public static async Task<CompositionDrawingSurface> LoadFromUri(Uri uri, Size sizeTarget, LoadTimeEffectHandler loadEffectHandler)
|
||||
{
|
||||
if (loadEffectHandler != null)
|
||||
{
|
||||
var bitmap = await CanvasBitmap.LoadAsync(_canvasDevice, uri);
|
||||
return loadEffectHandler(bitmap, _compositionDevice, sizeTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
return await LoadFromUri(uri, sizeTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Windows.Foundation.Metadata;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Behaviors
|
||||
{
|
||||
internal class ApiInformationHelper
|
||||
{
|
||||
// 1903 - 18362
|
||||
public static bool IsXamlRootAvailable { get; } = ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot");
|
||||
}
|
||||
}
|
|
@ -3,13 +3,13 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations.Expressions;
|
||||
using Microsoft.Toolkit.Uwp.UI.Behaviors;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations.Behaviors
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Behaviors
|
||||
{
|
||||
/// <summary>
|
||||
/// Performs an fade animation on a ListView or GridView Header using composition.
|
|
@ -3,7 +3,6 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations.Expressions;
|
||||
using Microsoft.Toolkit.Uwp.UI.Behaviors;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Composition;
|
||||
|
@ -12,7 +11,7 @@ using Windows.UI.Xaml.Controls;
|
|||
using Windows.UI.Xaml.Hosting;
|
||||
using Windows.UI.Xaml.Input;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations.Behaviors
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Behaviors
|
||||
{
|
||||
/// <summary>
|
||||
/// Performs an animation on a ListView or GridView Header to make it quick return using composition.
|
|
@ -3,7 +3,6 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations.Expressions;
|
||||
using Microsoft.Toolkit.Uwp.UI.Behaviors;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Composition;
|
||||
|
@ -13,7 +12,7 @@ using Windows.UI.Xaml.Hosting;
|
|||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations.Behaviors
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Behaviors
|
||||
{
|
||||
/// <summary>
|
||||
/// Performs an animation on a ListView or GridView Header to make it sticky using composition.
|
|
@ -0,0 +1,31 @@
|
|||
<Project Sdk="MSBuild.Sdk.Extras">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>uap10.0.17763</TargetFramework>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<Title>Windows Community Toolkit UI Behaviors</Title>
|
||||
<Description>
|
||||
This library provides UI behaviors built on the XAML behaviors SDK. It is part of the Windows Community Toolkit.
|
||||
|
||||
Behaviors:
|
||||
- BehaviorBase: Helper for building Behaviors
|
||||
- AutoFocusBehevior: Sets focus to the associated control.
|
||||
- FocusBehavior: Sets focus to a specified control.
|
||||
- ViewportBehavior: Listening for element to enter or exit the ScrollViewer viewport
|
||||
- FadeHeaderBehavior, QuickReturnHeaderBehavior, StickyHeaderBehavior: Helpers for ListViewBase Header Behavior
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows UI Behaviors XAML</PackageTags>
|
||||
|
||||
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- TODO: Including Animation reference for now for initial refactor of the ScrollHeader behaviors, we may be able to remove, but may also have some Behaviors for Animations? -->
|
||||
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Animations\Microsoft.Toolkit.Uwp.UI.Animations.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||
<Library Name="Microsoft.Toolkit.Uwp.UI.Behaviors">
|
||||
</Library>
|
||||
</Directives>
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// 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;
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations.Behaviors;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Microsoft.Xaml.Interactivity;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Scroll header control to be used with ListViews or GridViews
|
||||
/// </summary>
|
||||
public class ScrollHeader : ContentControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScrollHeader"/> class.
|
||||
/// </summary>
|
||||
public ScrollHeader()
|
||||
{
|
||||
DefaultStyleKey = typeof(ScrollHeader);
|
||||
HorizontalContentAlignment = HorizontalAlignment.Stretch;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the <see cref="Mode"/> property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ModeProperty =
|
||||
DependencyProperty.Register(nameof(Mode), typeof(ScrollHeaderMode), typeof(ScrollHeader), new PropertyMetadata(ScrollHeaderMode.None, OnModeChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the current mode.
|
||||
/// Default is none.
|
||||
/// </summary>
|
||||
public ScrollHeaderMode Mode
|
||||
{
|
||||
get { return (ScrollHeaderMode)GetValue(ModeProperty); }
|
||||
set { SetValue(ModeProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call <see cref="Control.ApplyTemplate"/>.
|
||||
/// </summary>
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
UpdateScrollHeaderBehavior();
|
||||
}
|
||||
|
||||
private static void OnModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
(d as ScrollHeader)?.UpdateScrollHeaderBehavior();
|
||||
}
|
||||
|
||||
private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
(d as ScrollHeader)?.OnApplyTemplate();
|
||||
}
|
||||
|
||||
private void UpdateScrollHeaderBehavior()
|
||||
{
|
||||
var targetListViewBase = this.FindAscendant<Windows.UI.Xaml.Controls.ListViewBase>();
|
||||
|
||||
if (targetListViewBase == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove previous behaviors
|
||||
foreach (var behavior in Interaction.GetBehaviors(targetListViewBase))
|
||||
{
|
||||
if (behavior is FadeHeaderBehavior || behavior is QuickReturnHeaderBehavior || behavior is StickyHeaderBehavior)
|
||||
{
|
||||
Interaction.GetBehaviors(targetListViewBase).Remove(behavior);
|
||||
}
|
||||
}
|
||||
|
||||
switch (Mode)
|
||||
{
|
||||
case ScrollHeaderMode.None:
|
||||
break;
|
||||
case ScrollHeaderMode.QuickReturn:
|
||||
Interaction.GetBehaviors(targetListViewBase).Add(new QuickReturnHeaderBehavior());
|
||||
break;
|
||||
case ScrollHeaderMode.Sticky:
|
||||
Interaction.GetBehaviors(targetListViewBase).Add(new StickyHeaderBehavior());
|
||||
break;
|
||||
case ScrollHeaderMode.Fade:
|
||||
Interaction.GetBehaviors(targetListViewBase).Add(new FadeHeaderBehavior());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
|
||||
<Style TargetType="controls:ScrollHeader">
|
||||
<Setter Property="IsTabStop" Value="False"></Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:ScrollHeader">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Hidden">
|
||||
<ContentPresenter />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,32 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Define mode available for <see cref="ScrollHeader"/>
|
||||
/// </summary>
|
||||
public enum ScrollHeaderMode
|
||||
{
|
||||
/// <summary>
|
||||
/// No change. This is the default value.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Enable quick return mode.
|
||||
/// </summary>
|
||||
QuickReturn,
|
||||
|
||||
/// <summary>
|
||||
/// Enable sticky mode.
|
||||
/// </summary>
|
||||
Sticky,
|
||||
|
||||
/// <summary>
|
||||
/// Enable fade mode.
|
||||
/// </summary>
|
||||
Fade
|
||||
}
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/RangeSelector/RangeSelector.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/RemoteDevicePicker/RemoteDevicePicker.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/RotatorTile/RotatorTile.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/ScrollHeader/ScrollHeader.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropperThumb.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/Eyedropper.xaml" />
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
|
||||
AdvancedCollectionView: It's a collection view implementation that support filtering, sorting and incremental loading. It's meant to be used in a viewmodel.
|
||||
|
||||
Behaviors:
|
||||
- BehaviorBase: Helper for building Behaviors
|
||||
- ViewportBehavior: Listening for element to enter or exit the ScrollViewer viewport
|
||||
|
||||
CacheBase: Provides methods and tools to cache files in a folder.
|
||||
|
||||
Converters: Commonly used converters that allow the data to be modified as it passes through the binding engine.
|
||||
|
@ -47,11 +43,7 @@
|
|||
|
||||
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -135,6 +135,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests.Tests.TAEF", "UITes
|
|||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "UITests.Tests.Shared", "UITests\UITests.Tests.Shared\UITests.Tests.Shared.shproj", "{1D8B0260-5C17-41DA-9C38-1E37441B3925}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Toolkit.Uwp.UI.Behaviors", "Microsoft.Toolkit.Uwp.UI.Behaviors\Microsoft.Toolkit.Uwp.UI.Behaviors.csproj", "{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
UITests\UITests.Tests.Shared\UITests.Tests.Shared.projitems*{05c83067-fa46-45e2-bec4-edee84ad18d0}*SharedItemsImports = 4
|
||||
|
@ -956,6 +958,26 @@ Global
|
|||
{C8182EF0-77FB-4B43-A588-C71748A309C7}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C8182EF0-77FB-4B43-A588-C71748A309C7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C8182EF0-77FB-4B43-A588-C71748A309C7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|ARM64.Build.0 = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|x64.Build.0 = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -997,6 +1019,7 @@ Global
|
|||
{5F720475-E263-4A5A-8C88-2B805B45B5BC} = {6FAA1CFE-3368-4FD2-9DBD-F4700F69174C}
|
||||
{C8182EF0-77FB-4B43-A588-C71748A309C7} = {6FAA1CFE-3368-4FD2-9DBD-F4700F69174C}
|
||||
{1D8B0260-5C17-41DA-9C38-1E37441B3925} = {6FAA1CFE-3368-4FD2-9DBD-F4700F69174C}
|
||||
{D4FF799D-0DF2-495A-ADC9-3BBC4AEF8971} = {F1AFFFA7-28FE-4770-BA48-10D76F3E59BC}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5403B0C4-F244-4F73-A35C-FE664D0F4345}
|
||||
|
|
Загрузка…
Ссылка в новой задаче