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 22 x : Class =" Files.DrivesWidget"
33 xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5+ xmlns : animations =" using:Microsoft.Toolkit.Uwp.UI.Animations"
56 xmlns : controls =" using:Microsoft.Toolkit.Uwp.UI.Controls"
67 xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
8+ xmlns : extensions =" using:Microsoft.Toolkit.Uwp.UI.Extensions"
79 xmlns : local =" using:Files"
810 xmlns : local2 =" using:Files.Filesystem"
911 xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
3739 </muxc : ItemsRepeater .Layout>
3840 <muxc : ItemsRepeater .ItemTemplate>
3941 <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>
4149 <Grid .Resources>
4250 <ResourceDictionary >
4351 <ResourceDictionary .ThemeDictionaries>
6775 Style =" {StaticResource ButtonRevealStyle}"
6876 Tag =" {x:Bind Path}"
6977 ToolTipService.ToolTip=" {x:Bind Text}" >
70-
7178 <Grid
7279 Margin =" 12"
7380 HorizontalAlignment =" Stretch"
Original file line number Diff line number Diff line change 22using Files . View_Models ;
33using System . Collections . Generic ;
44using System . Collections . ObjectModel ;
5+ using System . Numerics ;
56using Windows . UI . Xaml ;
67using Windows . UI . Xaml . Controls ;
8+ using Windows . UI . Xaml . Hosting ;
79
810namespace Files
911{
@@ -28,5 +30,21 @@ private void Button_Click(object sender, RoutedEventArgs e)
2830
2931 App . CurrentInstance . InstanceViewModel . IsPageTypeNotHome = true ; // show controls that were hidden on the home page
3032 }
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+ }
3149 }
3250}
Original file line number Diff line number Diff line change 22 x : Class =" Files.LibraryCards"
33 xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5+ xmlns : animations =" using:Microsoft.Toolkit.Uwp.UI.Animations"
56 xmlns : controls =" using:Microsoft.Toolkit.Uwp.UI.Controls"
67 xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
8+ xmlns : extensions =" using:Microsoft.Toolkit.Uwp.UI.Extensions"
79 xmlns : local =" using:Files"
810 xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
911 xmlns : muxc =" using:Microsoft.UI.Xaml.Controls"
2729 </muxc : ItemsRepeater .Layout>
2830 <muxc : ItemsRepeater .ItemTemplate>
2931 <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>
3139 <Grid .Resources>
3240 <ResourceDictionary >
3341 <ResourceDictionary .ThemeDictionaries>
Original file line number Diff line number Diff line change 11using Files . View_Models ;
22using Microsoft . Toolkit . Uwp . Extensions ;
33using System . Collections . Generic ;
4+ using System . Numerics ;
45using Windows . UI . Xaml ;
56using Windows . UI . Xaml . Controls ;
7+ using Windows . UI . Xaml . Hosting ;
68
79namespace Files
810{
@@ -23,6 +25,22 @@ public LibraryCards()
2325 foreach ( var item in itemsAdded ) { item . AutomationProperties = item . Text ; }
2426 }
2527
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+
2644 private void Button_Click ( object sender , RoutedEventArgs e )
2745 {
2846 string NavigationPath = "" ; // path to navigate
You can’t perform that action at this time.
0 commit comments