File tree Expand file tree Collapse file tree 4 files changed +54
-3
lines changed
Files/UserControls/Widgets Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Original file line number Diff line number Diff line change 2
2
x : Class =" Files.DrivesWidget"
3
3
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
4
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5
+ xmlns : animations =" using:Microsoft.Toolkit.Uwp.UI.Animations"
5
6
xmlns : controls =" using:Microsoft.Toolkit.Uwp.UI.Controls"
6
7
xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
8
+ xmlns : extensions =" using:Microsoft.Toolkit.Uwp.UI.Extensions"
7
9
xmlns : local =" using:Files"
8
10
xmlns : local2 =" using:Files.Filesystem"
9
11
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
37
39
</muxc : ItemsRepeater .Layout>
38
40
<muxc : ItemsRepeater .ItemTemplate>
39
41
<DataTemplate x : DataType =" local2:DriveItem" >
40
- <Grid >
42
+ <Grid
43
+ extensions:VisualExtensions.CenterPoint=" 80,45,0"
44
+ PointerEntered =" GridScaleUp"
45
+ PointerExited =" GridScaleNormal" >
46
+ <animations : Implicit .Animations>
47
+ <animations : ScaleAnimation Duration =" 0:0:0.5" />
48
+ </animations : Implicit .Animations>
41
49
<Grid .Resources>
42
50
<ResourceDictionary >
43
51
<ResourceDictionary .ThemeDictionaries>
67
75
Style =" {StaticResource ButtonRevealStyle}"
68
76
Tag =" {x:Bind Path}"
69
77
ToolTipService.ToolTip=" {x:Bind Text}" >
70
-
71
78
<Grid
72
79
Margin =" 12"
73
80
HorizontalAlignment =" Stretch"
Original file line number Diff line number Diff line change 2
2
using Files . View_Models ;
3
3
using System . Collections . Generic ;
4
4
using System . Collections . ObjectModel ;
5
+ using System . Numerics ;
5
6
using Windows . UI . Xaml ;
6
7
using Windows . UI . Xaml . Controls ;
8
+ using Windows . UI . Xaml . Hosting ;
7
9
8
10
namespace Files
9
11
{
@@ -28,5 +30,21 @@ private void Button_Click(object sender, RoutedEventArgs e)
28
30
29
31
App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome = true ; // show controls that were hidden on the home page
30
32
}
33
+
34
+ private void GridScaleUp ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
35
+ {
36
+ // Source for the scaling: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Implicit%20Animations/ImplicitAnimationsPage.xaml.cs
37
+ // Search for "Scale Element".
38
+ var element = sender as UIElement ;
39
+ var visual = ElementCompositionPreview . GetElementVisual ( element ) ;
40
+ visual . Scale = new Vector3 ( 1.03f , 1.03f , 1 ) ;
41
+ }
42
+
43
+ private void GridScaleNormal ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
44
+ {
45
+ var element = sender as UIElement ;
46
+ var visual = ElementCompositionPreview . GetElementVisual ( element ) ;
47
+ visual . Scale = new Vector3 ( 1 ) ;
48
+ }
31
49
}
32
50
}
Original file line number Diff line number Diff line change 2
2
x : Class =" Files.LibraryCards"
3
3
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
4
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5
+ xmlns : animations =" using:Microsoft.Toolkit.Uwp.UI.Animations"
5
6
xmlns : controls =" using:Microsoft.Toolkit.Uwp.UI.Controls"
6
7
xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
8
+ xmlns : extensions =" using:Microsoft.Toolkit.Uwp.UI.Extensions"
7
9
xmlns : local =" using:Files"
8
10
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
9
11
xmlns : muxc =" using:Microsoft.UI.Xaml.Controls"
27
29
</muxc : ItemsRepeater .Layout>
28
30
<muxc : ItemsRepeater .ItemTemplate>
29
31
<DataTemplate x : DataType =" local:FavoriteLocationItem" >
30
- <Grid >
32
+ <Grid
33
+ extensions:VisualExtensions.CenterPoint=" 80,45,0"
34
+ PointerEntered =" GridScaleUp"
35
+ PointerExited =" GridScaleNormal" >
36
+ <animations : Implicit .Animations>
37
+ <animations : ScaleAnimation Duration =" 0:0:0.5" />
38
+ </animations : Implicit .Animations>
31
39
<Grid .Resources>
32
40
<ResourceDictionary >
33
41
<ResourceDictionary .ThemeDictionaries>
Original file line number Diff line number Diff line change 1
1
using Files . View_Models ;
2
2
using Microsoft . Toolkit . Uwp . Extensions ;
3
3
using System . Collections . Generic ;
4
+ using System . Numerics ;
4
5
using Windows . UI . Xaml ;
5
6
using Windows . UI . Xaml . Controls ;
7
+ using Windows . UI . Xaml . Hosting ;
6
8
7
9
namespace Files
8
10
{
@@ -23,6 +25,22 @@ public LibraryCards()
23
25
foreach ( var item in itemsAdded ) { item . AutomationProperties = item . Text ; }
24
26
}
25
27
28
+ private void GridScaleUp ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
29
+ {
30
+ // Source for the scaling: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Implicit%20Animations/ImplicitAnimationsPage.xaml.cs
31
+ // Search for "Scale Element".
32
+ var element = sender as UIElement ;
33
+ var visual = ElementCompositionPreview . GetElementVisual ( element ) ;
34
+ visual . Scale = new Vector3 ( 1.03f , 1.03f , 1 ) ;
35
+ }
36
+
37
+ private void GridScaleNormal ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
38
+ {
39
+ var element = sender as UIElement ;
40
+ var visual = ElementCompositionPreview . GetElementVisual ( element ) ;
41
+ visual . Scale = new Vector3 ( 1 ) ;
42
+ }
43
+
26
44
private void Button_Click ( object sender , RoutedEventArgs e )
27
45
{
28
46
string NavigationPath = "" ; // path to navigate
You can’t perform that action at this time.
0 commit comments