Skip to content

Commit 25249e9

Browse files
marcelwgnkarkarl
authored andcommitted
Cleanup unnecessary code (#1299)
1 parent dc32075 commit 25249e9

32 files changed

Lines changed: 219 additions & 612 deletions

WinUIGallery/App.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar
116116
startupWindow = WindowHelper.CreateWindow();
117117
startupWindow.ExtendsContentIntoTitleBar = true;
118118
#if DEBUG
119-
//if (System.Diagnostics.Debugger.IsAttached)
120-
//{
121-
// this.DebugSettings.EnableFrameRateCounter = true;
122-
//}
123-
124119
if (System.Diagnostics.Debugger.IsAttached)
125120
{
126121
this.DebugSettings.BindingFailed += DebugSettings_BindingFailed;

WinUIGallery/Common/ActivityFeedLayout.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using Windows.Foundation;
44
using Microsoft.UI.Xaml;
@@ -95,8 +95,7 @@ private static void OnPropertyChanged(DependencyObject obj, DependencyPropertyCh
9595
protected override void InitializeForContextCore(VirtualizingLayoutContext context)
9696
{
9797
base.InitializeForContextCore(context);
98-
99-
if (!(context.LayoutState is ActivityFeedLayoutState state))
98+
if (!(context.LayoutState is ActivityFeedLayoutState))
10099
{
101100
// Store any state we might need since (in theory) the layout could be in use by multiple
102101
// elements simultaneously
@@ -169,7 +168,6 @@ protected override Size MeasureOverride(VirtualizingLayoutContext context, Size
169168
for (int columnIndex = 0; columnIndex < 3; columnIndex++)
170169
{
171170
var index = firstItemIndex + columnIndex;
172-
var rect = boundsForCurrentRow[index % 3];
173171
var container = context.GetOrCreateElementAt(index);
174172

175173
container.Measure(

WinUIGallery/Common/Category.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Microsoft.UI.Xaml.Controls;
33

44
namespace AppUIBasics.Common
@@ -11,7 +11,6 @@ public class Category : CategoryBase
1111
public string Name { get; set; }
1212
public string Tooltip { get; set; }
1313
public Symbol Glyph { get; set; }
14-
//public Type TargetType { get; set; }
1514
}
1615

1716
public class Separator : CategoryBase { }

WinUIGallery/Common/ColorSlideTransitionHelper.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//*********************************************************
1+
//*********************************************************
22
//
33
// Copyright (c) Microsoft. All rights reserved.
44
// This code is licensed under the MIT License (MIT).
@@ -25,7 +25,6 @@ public class ColorSlideTransitionHelper
2525
{
2626
#region Member variables
2727

28-
UIElement hostForVisual;
2928
Compositor _compositor;
3029
ContainerVisual _containerForVisuals;
3130
ScalarKeyFrameAnimation _slideAnimation;
@@ -42,10 +41,6 @@ public class ColorSlideTransitionHelper
4241
/// </summary>
4342
public ColorSlideTransitionHelper(UIElement hostForVisual)
4443
{
45-
46-
47-
this.hostForVisual = hostForVisual;
48-
4944
// we have an element in the XAML tree that will host our Visuals
5045
var visual = ElementCompositionPreview.GetElementVisual(hostForVisual);
5146
_compositor = visual.Compositor;

WinUIGallery/Common/MenuItemTemplateSelector.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.UI.Xaml;
1+
using Microsoft.UI.Xaml;
22
using Microsoft.UI.Xaml.Controls;
33
using Microsoft.UI.Xaml.Markup;
44
using System;
@@ -11,8 +11,6 @@ class MenuItemTemplateSelector : DataTemplateSelector
1111
{
1212
public DataTemplate ItemTemplate { get; set; }
1313

14-
//public string PaneTitle { get; set; }
15-
1614
protected override DataTemplate SelectTemplateCore(object item)
1715
{
1816
return item is Separator ? SeparatorTemplate : item is Header ? HeaderTemplate : ItemTemplate;

WinUIGallery/Common/Win32.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ internal static class Win32
1919

2020
public const int WM_ACTIVATE = 0x0006;
2121
public const int WA_ACTIVE = 0x01;
22-
//static int WA_CLICKACTIVE = 0x02;
2322
public const int WA_INACTIVE = 0x00;
2423

2524
public const int WM_SETICON = 0x0080;

WinUIGallery/Common/WrapPanel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.CodeAnalysis;
44
using System.Globalization;
@@ -38,7 +38,6 @@ public class WrapPanel : Panel
3838
/// within a <see cref="T:WinRTXamlToolkit.Controls.WrapPanel" />. The
3939
/// default value is <see cref="F:System.Double.NaN" />.
4040
/// </value>
41-
//[TypeConverter(typeof(LengthConverter))]
4241
public double ItemHeight
4342
{
4443
get { return (double)GetValue(ItemHeightProperty); }
@@ -73,7 +72,6 @@ public double ItemHeight
7372
/// contained in a <see cref="T:WinRTXamlToolkit.Controls.WrapPanel" />.
7473
/// The default value is <see cref="F:System.Double.NaN" />.
7574
/// </value>
76-
//[TypeConverter(typeof(LengthConverter))]
7775
public double ItemWidth
7876
{
7977
get { return (double)GetValue(ItemWidthProperty); }

WinUIGallery/ConnectedAnimationPages/CollectionPage.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Microsoft.UI.Xaml;
33
using Microsoft.UI.Xaml.Controls;
44
using Microsoft.UI.Xaml.Media.Animation;
@@ -59,8 +59,7 @@ private void collection_ItemClick(object sender, ItemClickEventArgs e)
5959
// Prepare the connected animation.
6060
// Notice that the stored item is passed in, as well as the name of the connected element.
6161
// The animation will actually start on the Detailed info page.
62-
var animation = collection.PrepareConnectedAnimation("ForwardConnectedAnimation", _storeditem, "connectedElement");
63-
62+
collection.PrepareConnectedAnimation("ForwardConnectedAnimation", _storeditem, "connectedElement");
6463
}
6564

6665
// Navigate to the DetailedInfoPage.

WinUIGallery/ControlPages/AppBarSeparatorPage.xaml.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,5 @@ public AppBarSeparatorPage()
2020
{
2121
this.InitializeComponent();
2222
}
23-
private void CompactButton_Click(object sender, RoutedEventArgs e)
24-
{
25-
if ((sender as AppBarToggleButton).IsChecked == true)
26-
{
27-
Control1.DefaultLabelPosition = CommandBarDefaultLabelPosition.Collapsed;
28-
}
29-
else
30-
{
31-
Control1.DefaultLabelPosition = CommandBarDefaultLabelPosition.Bottom;
32-
}
33-
}
3423
}
3524
}

WinUIGallery/ControlPages/AppBarToggleButtonPage.xaml.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@ public AppBarToggleButtonPage()
2121
this.InitializeComponent();
2222
}
2323

24-
private void CompactButton_Click(object sender, RoutedEventArgs e)
25-
{
26-
if (sender is ToggleButton toggle && toggle.IsChecked != null)
27-
{
28-
Button1.IsCompact =
29-
Button2.IsCompact =
30-
Button3.IsCompact =
31-
Button4.IsCompact = (bool)toggle.IsChecked;
32-
}
33-
}
34-
3524
private void AppBarButton_Click(object sender, RoutedEventArgs e)
3625
{
3726
if (sender is AppBarToggleButton b)

0 commit comments

Comments
 (0)