Skip to content

Commit 24c30ed

Browse files
Merge branch 'master' into mhawker/ttb-style
2 parents fcd7a9b + 5dd5ee2 commit 24c30ed

File tree

45 files changed

+759
-270
lines changed

Some content is hidden

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

45 files changed

+759
-270
lines changed

Directory.Build.props

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\nupkg</PackageOutputPath>
2020
</PropertyGroup>
2121

22-
<PropertyGroup>
23-
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true' and '$(IsTestSampleProject)' != 'true'" >true</SignAssembly>
24-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
25-
</PropertyGroup>
26-
2722
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
2823
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2924
</PropertyGroup>

Directory.Build.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
</ItemGroup>
2222
</When>
2323
</Choose>
24+
25+
<Choose>
26+
<When Condition="$(TargetFramework.Contains('uap10.0')) == false and '$(TargetFramework)' != 'native' and '$(IsTestSampleProject)' != 'true'">
27+
<PropertyGroup>
28+
<SignAssembly>true</SignAssembly>
29+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
30+
</PropertyGroup>
31+
</When>
32+
</Choose>
2433

2534
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
2635
<ItemGroup>

Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@
605605
<Content Include="SamplePages\IconExtensions\IconExtensionsXaml.bind" />
606606
<Content Include="SamplePages\WrapLayout\WrapLayout.bind" />
607607
<Content Include="SamplePages\ObservableGroup\ObservableGroup.bind" />
608+
<Content Include="SamplePages\ScrollViewerExtensions\ScrollViewerExtensionsXaml.bind" />
608609
<Content Include="SamplePages\Triggers\CompareStateTrigger.bind" />
609610
<Content Include="SamplePages\Triggers\IsEqualStateTrigger.bind" />
610611
<Content Include="SamplePages\Triggers\FullScreenModeStateTrigger.bind" />

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PipelineBrush/PipelineBrushPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<effects:ExposureEffect/>
2727
<effects:GrayscaleEffect/>
2828
<effects:HueRotationEffect/>
29+
<effects:CrossFadeEffect/>
2930
</media:PipelineBrush>
3031
</Border.Background>
3132
</Border>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PipelineBrush/PipelineBrushXaml.bind

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<effects:BlendEffect Mode="Multiply" Source="{effects:BackdropSource}"/>
2727
<effects:BlurEffect Amount="16"/>
2828
<effects:ShadeEffect Color="#FF222222" Intensity="0.2"/>
29-
<effects:BlendEffect Mode="Overlay" Placement="Background" Source="{effects:TileSource Uri=ms-appx:///Assets/BrushAssets/NoiseTexture.png}"/>
30-
<effects:BlendEffect Mode="Overlay" Placement="Background" Source="{effects:ImageSource Uri=ms-appx:///SamplePages/DropShadowPanel/Unicorn.png}"/>
29+
<effects:BlendEffect Mode="Overlay" Source="{effects:TileSource Uri=ms-appx:///Assets/BrushAssets/NoiseTexture.png}"/>
30+
<effects:BlendEffect Mode="Overlay" Source="{effects:ImageSource Uri=ms-appx:///SamplePages/DropShadowPanel/Unicorn.png}"/>
3131
</brushes:PipelineBrush>
3232
</Border.Background>
3333
</Border>
Lines changed: 8 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,10 @@
1-
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:common="using:Microsoft.Toolkit.Uwp.SampleApp.Common"
4-
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
7-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8-
mc:Ignorable="d">
1+
// C# - Scale can be applied to any UIElement. In this case it is an image called ToolkitLogo.
2+
using Microsoft.Toolkit.Uwp.UI.Extensions;
93

10-
<Page.Resources>
11-
<common:DoubleTopThicknessConverter x:Key="DoubleTopThicknessConverter" />
12-
</Page.Resources>
4+
// Binds the Y scroll axis of the ScrollViewer to the Y translation axis of the target
5+
listScrollViewer.StartExpressionAnimation(shapesPanel, Axis.Y);
136

14-
<Grid>
15-
<ListView Name="listView"
16-
extensions:ScrollViewerExtensions.VerticalScrollBarMargin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
17-
extensions:ScrollViewerExtensions.EnableMiddleClickScrolling="@[EnableMiddleClickScrolling:Bool:True]">
18-
<ListView.Header>
19-
<controls:ScrollHeader Mode="Sticky">
20-
<Grid x:Name="MyHeaderGrid"
21-
MinHeight="@[Header MinHeight:DoubleSlider:250:150-500]"
22-
Background="{ThemeResource Brush-Sample-TransparentHeader}">
23-
<StackPanel HorizontalAlignment="Center"
24-
VerticalAlignment="Center">
25-
<TextBlock Margin="12"
26-
FontSize="48"
27-
FontWeight="Bold"
28-
Foreground="{ThemeResource Brush-Main}"
29-
Text="Scroll Header"
30-
TextAlignment="Center"
31-
TextWrapping="WrapWholeWords" />
32-
<TextBlock Margin="12,0,12,12"
33-
VerticalAlignment="Center"
34-
Foreground="{ThemeResource Brush-Main}"
35-
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."
36-
TextAlignment="Center"
37-
TextWrapping="WrapWholeWords" />
38-
</StackPanel>
39-
</Grid>
40-
</controls:ScrollHeader>
41-
</ListView.Header>
42-
<ListView.ItemTemplate>
43-
<DataTemplate>
44-
<Grid MinHeight="100"
45-
Background="{ThemeResource Brush-Grey-03}">
46-
<Grid.ColumnDefinitions>
47-
<ColumnDefinition Width="Auto" />
48-
<ColumnDefinition Width="*" />
49-
</Grid.ColumnDefinitions>
50-
<Image x:Name="ToolkitLogo"
51-
Grid.Column="0"
52-
Width="100"
53-
Height="100"
54-
Margin="0,0,24,0"
55-
Source="ms-appx:///Assets/ToolkitLogo.png" />
56-
<TextBlock Grid.Column="1"
57-
VerticalAlignment="Center"
58-
Text="{Binding Title}"
59-
TextTrimming="CharacterEllipsis" />
60-
</Grid>
61-
</DataTemplate>
62-
</ListView.ItemTemplate>
63-
<ListView.ItemContainerStyle>
64-
<Style TargetType="ListViewItem">
65-
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
66-
<Setter Property="Padding" Value="12,12,24,12" />
67-
</Style>
68-
</ListView.ItemContainerStyle>
69-
</ListView>
70-
</Grid>
71-
</Page>
7+
// It is also possible to synchronize different axes, as well as targeting
8+
// different Visual properties. By default, the expression works with the
9+
// Visual.Translate property, but Visual.Offset can be used as well.
10+
listScrollViewer.StartExpressionAnimation(shapesPanel, Axis.X, Axis.Y, VisualProperty.Offset);

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ScrollViewerExtensions/ScrollViewerExtensionsPage.xaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
</ListView.Header>
4141
<ListView.ItemTemplate>
4242
<DataTemplate>
43-
<Grid MinHeight="100"
44-
Background="{ThemeResource Brush-Grey-03}">
43+
<Grid MinHeight="100" Background="Blue">
4544
<Grid.ColumnDefinitions>
4645
<ColumnDefinition Width="Auto" />
4746
<ColumnDefinition Width="*" />
@@ -66,5 +65,46 @@
6665
</Style>
6766
</ListView.ItemContainerStyle>
6867
</ListView>
68+
<StackPanel x:Name="shapesPanel"
69+
HorizontalAlignment="Center"
70+
Margin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
71+
Padding="88"
72+
Spacing="32">
73+
<Polygon Height="100"
74+
Width="100"
75+
Points="0,0 0,72 44,36"
76+
Stroke="DarkGreen"
77+
Fill="Green"
78+
VerticalAlignment="Center"
79+
HorizontalAlignment="Center"/>
80+
<StackPanel Orientation="Horizontal"
81+
VerticalAlignment="Center"
82+
HorizontalAlignment="Center"
83+
Spacing="4"
84+
Height="84"
85+
Width="100">
86+
<Polygon Points="0,0 0,56 32,28"
87+
Stroke="Blue"
88+
Fill="DodgerBlue"/>
89+
<Polygon Points="0,0 0,56 32,28"
90+
Stroke="Blue"
91+
Fill="DodgerBlue"/>
92+
</StackPanel>
93+
<TextBlock
94+
Height="100"
95+
FontSize="24"
96+
TextAlignment="Center">
97+
<Run Text="Look at me, I'm floating between"/>
98+
<LineBreak/>
99+
<Run Text="two different ListView items!"/>
100+
</TextBlock>
101+
<Polygon Height="100"
102+
Width="100"
103+
Points="0,0 0,60 60,60 60,0"
104+
Stroke="DarkRed"
105+
Fill="Crimson"
106+
VerticalAlignment="Center"
107+
HorizontalAlignment="Center"/>
108+
</StackPanel>
69109
</Grid>
70110
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ScrollViewerExtensions/ScrollViewerExtensionsPage.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
using System.Collections.ObjectModel;
66
using Microsoft.Toolkit.Uwp.SampleApp.Models;
7-
using Microsoft.Toolkit.Uwp.UI.Controls;
87
using Microsoft.Toolkit.Uwp.UI.Extensions;
98
using Windows.UI.Xaml;
109
using Windows.UI.Xaml.Controls;
11-
using Windows.UI.Xaml.Navigation;
1210

1311
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1412
{
@@ -35,6 +33,14 @@ public void OnXamlRendered(FrameworkElement control)
3533
if (listView != null)
3634
{
3735
listView.ItemsSource = _items;
36+
37+
var shapesPanel = control.FindChildByName("shapesPanel") as StackPanel;
38+
if (shapesPanel != null)
39+
{
40+
var listScrollViewer = listView.FindDescendant<ScrollViewer>();
41+
42+
listScrollViewer?.StartExpressionAnimation(shapesPanel, Axis.Y);
43+
}
3844
}
3945
}
4046
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:common="using:Microsoft.Toolkit.Uwp.SampleApp.Common"
4+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d">
9+
10+
<Page.Resources>
11+
<common:DoubleTopThicknessConverter x:Key="DoubleTopThicknessConverter" />
12+
</Page.Resources>
13+
14+
<Grid>
15+
<ListView Name="listView"
16+
extensions:ScrollViewerExtensions.VerticalScrollBarMargin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
17+
extensions:ScrollViewerExtensions.EnableMiddleClickScrolling="@[EnableMiddleClickScrolling:Bool:True]">
18+
<ListView.Header>
19+
<controls:ScrollHeader Mode="Sticky">
20+
<Grid x:Name="MyHeaderGrid"
21+
MinHeight="@[Header MinHeight:DoubleSlider:250:150-500]"
22+
Background="{ThemeResource Brush-Sample-TransparentHeader}">
23+
<StackPanel HorizontalAlignment="Center"
24+
VerticalAlignment="Center">
25+
<TextBlock Margin="12"
26+
FontSize="48"
27+
FontWeight="Bold"
28+
Foreground="{ThemeResource Brush-Main}"
29+
Text="Scroll Header"
30+
TextAlignment="Center"
31+
TextWrapping="WrapWholeWords" />
32+
<TextBlock Margin="12,0,12,12"
33+
VerticalAlignment="Center"
34+
Foreground="{ThemeResource Brush-Main}"
35+
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."
36+
TextAlignment="Center"
37+
TextWrapping="WrapWholeWords" />
38+
</StackPanel>
39+
</Grid>
40+
</controls:ScrollHeader>
41+
</ListView.Header>
42+
<ListView.ItemTemplate>
43+
<DataTemplate>
44+
<Grid MinHeight="100"
45+
Background="{ThemeResource Brush-Grey-03}">
46+
<Grid.ColumnDefinitions>
47+
<ColumnDefinition Width="Auto" />
48+
<ColumnDefinition Width="*" />
49+
</Grid.ColumnDefinitions>
50+
<Image x:Name="ToolkitLogo"
51+
Grid.Column="0"
52+
Width="100"
53+
Height="100"
54+
Margin="0,0,24,0"
55+
Source="ms-appx:///Assets/ToolkitLogo.png" />
56+
<TextBlock Grid.Column="1"
57+
VerticalAlignment="Center"
58+
Text="{Binding Title}"
59+
TextTrimming="CharacterEllipsis" />
60+
</Grid>
61+
</DataTemplate>
62+
</ListView.ItemTemplate>
63+
<ListView.ItemContainerStyle>
64+
<Style TargetType="ListViewItem">
65+
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
66+
<Setter Property="Padding" Value="12,12,24,12" />
67+
</Style>
68+
</ListView.ItemContainerStyle>
69+
</ListView>
70+
71+
<!--This is the panel that will be animated in sync with the main ScrollViewer control inside
72+
the ListView in the page, using the ScrollViewerExtensions leveraging composition ExpressionAnimations.
73+
We use x:Name here to be able to reference the panel from code behind and start the animation.
74+
To inspect the C# code beind used, switch to the "Code" tab in this sample page.-->
75+
<StackPanel x:Name="shapesPanel"
76+
HorizontalAlignment="Center"
77+
Margin="{Binding MinHeight, ElementName=MyHeaderGrid, Converter={StaticResource DoubleTopThicknessConverter}}"
78+
Padding="88"
79+
Spacing="32">
80+
<Polygon Height="100"
81+
Width="100"
82+
Points="0,0 0,72 44,36"
83+
Stroke="DarkGreen"
84+
Fill="Green"
85+
VerticalAlignment="Center"
86+
HorizontalAlignment="Center"/>
87+
<StackPanel Orientation="Horizontal"
88+
VerticalAlignment="Center"
89+
HorizontalAlignment="Center"
90+
Spacing="4"
91+
Height="84"
92+
Width="100">
93+
<Polygon Points="0,0 0,56 32,28"
94+
Stroke="Blue"
95+
Fill="DodgerBlue"/>
96+
<Polygon Points="0,0 0,56 32,28"
97+
Stroke="Blue"
98+
Fill="DodgerBlue"/>
99+
</StackPanel>
100+
<TextBlock
101+
Height="100"
102+
FontSize="24"
103+
TextAlignment="Center">
104+
<Run Text="Look at me, I'm floating between"/>
105+
<LineBreak/>
106+
<Run Text="two different ListView items!"/>
107+
</TextBlock>
108+
<Polygon Height="100"
109+
Width="100"
110+
Points="0,0 0,60 60,60 60,0"
111+
Stroke="DarkRed"
112+
Fill="Crimson"
113+
VerticalAlignment="Center"
114+
HorizontalAlignment="Center"/>
115+
</StackPanel>
116+
</Grid>
117+
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TabView/TabViewPage.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1414
{
1515
public sealed partial class TabViewPage : Page, IXamlRenderListener
1616
{
17+
#pragma warning disable CS0618 // Type or member is obsolete
1718
private TabView _tabs;
1819

1920
private int _counter = 1;
@@ -67,5 +68,6 @@ private void Tabs_TabDraggedOutside(object sender, TabDraggedOutsideEventArgs e)
6768

6869
TabViewNotification.Show("Tore Tab '" + str + "' Outside of TabView.", 2000);
6970
}
70-
}
71+
#pragma warning restore CS0618 // Type or member is obsolete
72+
}
7173
}

0 commit comments

Comments
 (0)