Skip to content

Commit 8769e4c

Browse files
committed
Rename MediaSlideshow -> PanelSlideshow + First test
1 parent 8332927 commit 8769e4c

18 files changed

+400
-132
lines changed

BackgroundTest/App.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
88
<ResourceDictionary Source="ms-appx:///CustomControl/NewPipsPager/NewPipsPager_themeresources.xaml" />
99
<ResourceDictionary Source="ms-appx:///CustomControl/NewPipsPager/NewPipsPager.xaml" />
10+
11+
<ResourceDictionary Source="ms-appx:///CustomControl/PanelSlideshow/PanelSlideshow.xaml" />
1012
<ResourceDictionary>
1113
<ResourceDictionary.ThemeDictionaries>
1214
<ResourceDictionary x:Key="Default">

BackgroundTest/BackgroundTest.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@
6868
<Optimize>true</Optimize>
6969
<GitSkipCache>true</GitSkipCache>
7070
</PropertyGroup>
71+
7172
<ItemGroup>
72-
<None Remove="CustomControl\BGTestImage.jpg" />
73-
</ItemGroup>
74-
<ItemGroup>
75-
<Content Include="CustomControl\BGTestImage.jpg">
73+
<Content Include="CustomControl\BGTestImage*">
7674
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
7775
</Content>
7876
</ItemGroup>
File renamed without changes.
912 KB
Loading
381 KB
Loading

BackgroundTest/CustomControl/NewPipsPager/NewPipsPagerExtension.cs renamed to BackgroundTest/CustomControl/Extensions.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@
44
using System;
55
using System.Runtime.CompilerServices;
66

7-
namespace BackgroundTest.CustomControl.NewPipsPager;
7+
namespace BackgroundTest.CustomControl;
88

9-
public static class NewPipsPagerExtension
9+
public static class Extensions
1010
{
1111
public static readonly DependencyProperty CursorTypeProperty =
1212
DependencyProperty.RegisterAttached("CursorType", typeof(InputSystemCursorShape),
13-
typeof(UIElement), new PropertyMetadata(false));
13+
typeof(UIElement), new PropertyMetadata(InputSystemCursorShape.Arrow));
1414

15-
public static InputSystemCursorShape GetCursorType(DependencyObject obj)
16-
{
17-
return (InputSystemCursorShape)obj.GetValue(CursorTypeProperty);
18-
}
15+
public static InputSystemCursorShape GetCursorType(DependencyObject obj) => (InputSystemCursorShape)obj.GetValue(CursorTypeProperty);
1916

2017
public static void SetCursorType(DependencyObject obj, InputSystemCursorShape value)
2118
{
2219
InputSystemCursor? cursor = InputSystemCursor.Create(value);
23-
if (cursor == null ||
20+
if (cursor is null ||
2421
obj is not UIElement asElement)
2522
{
2623
return;
@@ -36,15 +33,16 @@ public static void SetCursorType(DependencyObject obj, InputSystemCursorShape va
3633
private extern DependencyObject GetTemplateChildAccessor(string name);
3734

3835
internal T GetTemplateChild<T>(string name)
36+
where T : class
3937
{
4038
DependencyObject obj = source.GetTemplateChildAccessor(name);
41-
if (obj is not T)
39+
if (obj is not T castObj)
4240
{
4341
throw new
4442
InvalidCastException($"Cannot cast type to: {typeof(T).Name} as the object expects type: {obj.GetType().Name}");
4543
}
4644

47-
return (T)(object)obj;
45+
return castObj;
4846
}
4947
}
5048

BackgroundTest/CustomControl/MediaSlideshow/MediaSlideshow.Events.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

BackgroundTest/CustomControl/MediaSlideshow/MediaSlideshow.Properties.cs

Lines changed: 0 additions & 82 deletions
This file was deleted.

BackgroundTest/CustomControl/MediaSlideshow/MediaSlideshow.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

BackgroundTest/CustomControl/NewPipsPager/NewPipsPager.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- ReSharper disable Xaml.StaticResourceNotResolved -->
33
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:customControls="using:BackgroundTest.CustomControl"
56
xmlns:controls="using:BackgroundTest.CustomControl.NewPipsPager">
67

7-
<ThemeShadow x:Key="SharedShadow" />
88
<controls:IndexAddOneConverter x:Key="IndexAddOneConverter" />
99

1010
<Style TargetType="controls:NewPipsPager">
@@ -104,7 +104,7 @@
104104
HorizontalAlignment="Center"
105105
VerticalAlignment="Center"
106106
Style="{ThemeResource NewPipsPagerPreviousPageButtonStyle}"
107-
controls:NewPipsPagerExtension.CursorType="Hand"
107+
customControls:Extensions.CursorType="Hand"
108108
ToolTipService.Placement="Top"
109109
ToolTipService.ToolTip="{Binding ElementName=PreviousPageButton, Path=(AutomationProperties.Name)}"
110110
Margin="0, 0, 0, 4"/>
@@ -131,7 +131,7 @@
131131
Foreground="{ThemeResource NewPipsPageButtonForeground}"
132132
Background="{ThemeResource NewPipsPageButtonBackground}"
133133
CornerRadius="{ThemeResource PipsPagerCornerRadius}"
134-
controls:NewPipsPagerExtension.CursorType="Hand"
134+
customControls:Extensions.CursorType="Hand"
135135
IsTabStop="False"
136136
Tag="{Binding}"
137137
ToolTipService.Placement="Top"
@@ -145,7 +145,7 @@
145145
HorizontalAlignment="Center"
146146
VerticalAlignment="Center"
147147
Style="{ThemeResource NewPipsPagerNextPageButtonStyle}"
148-
controls:NewPipsPagerExtension.CursorType="Hand"
148+
customControls:Extensions.CursorType="Hand"
149149
ToolTipService.Placement="Bottom"
150150
ToolTipService.ToolTip="{Binding ElementName=NextPageButton, Path=(AutomationProperties.Name)}"
151151
Margin="0, 4, 0, 0"/>

0 commit comments

Comments
 (0)