diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs
index 9fb91746991e..1021ebc24824 100644
--- a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs
+++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs
@@ -1,11 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Input;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs
index 5d17a8ba78da..e348fbd682bd 100644
--- a/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs
+++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs
@@ -2,11 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.UI.Xaml.Data;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Windows.Foundation.Collections;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs b/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs
index b636700e395a..4d9fd74339c6 100644
--- a/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs
+++ b/src/Files.App.Controls/AdaptiveGridView/AdaptiveHeightValueConverter.cs
@@ -2,11 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.UI.Xaml.Data;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/BladeView/BladeItem.Events.cs b/src/Files.App.Controls/BladeView/BladeItem.Events.cs
index c4dbac9304d0..4b0706c2a16e 100644
--- a/src/Files.App.Controls/BladeView/BladeItem.Events.cs
+++ b/src/Files.App.Controls/BladeView/BladeItem.Events.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Files.App.Controls
{
///
diff --git a/src/Files.App.Controls/BladeView/BladeItem.Properties.cs b/src/Files.App.Controls/BladeView/BladeItem.Properties.cs
index 5678d63a1c2a..327a0d59fa2d 100644
--- a/src/Files.App.Controls/BladeView/BladeItem.Properties.cs
+++ b/src/Files.App.Controls/BladeView/BladeItem.Properties.cs
@@ -1,13 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.UI.Xaml.Media;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs b/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs
index 0666e56460ae..7c6ec7f7764a 100644
--- a/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs
+++ b/src/Files.App.Controls/BladeView/BladeItemAutomationPeer.cs
@@ -2,13 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
using CommunityToolkit.WinUI;
-using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Automation;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.UI.Xaml.Automation.Peers;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/BladeView/BladeMode.cs b/src/Files.App.Controls/BladeView/BladeMode.cs
index 123d36a2d8d5..7e5250700ee2 100644
--- a/src/Files.App.Controls/BladeView/BladeMode.cs
+++ b/src/Files.App.Controls/BladeView/BladeMode.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Files.App.Controls
{
///
diff --git a/src/Files.App.Controls/BladeView/BladeView.Events.cs b/src/Files.App.Controls/BladeView/BladeView.Events.cs
index c60e719c876e..69984d8a7281 100644
--- a/src/Files.App.Controls/BladeView/BladeView.Events.cs
+++ b/src/Files.App.Controls/BladeView/BladeView.Events.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace Files.App.Controls
{
///
diff --git a/src/Files.App.Controls/BladeView/BladeView.Properties.cs b/src/Files.App.Controls/BladeView/BladeView.Properties.cs
index c953163127e3..6956c1117bc0 100644
--- a/src/Files.App.Controls/BladeView/BladeView.Properties.cs
+++ b/src/Files.App.Controls/BladeView/BladeView.Properties.cs
@@ -1,11 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Windows.Foundation;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/BladeView/BladeView.cs b/src/Files.App.Controls/BladeView/BladeView.cs
index 48456f58261f..ba3535f73677 100644
--- a/src/Files.App.Controls/BladeView/BladeView.cs
+++ b/src/Files.App.Controls/BladeView/BladeView.cs
@@ -3,11 +3,6 @@
using CommunityToolkit.WinUI;
using Microsoft.UI.Xaml.Automation.Peers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
diff --git a/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs b/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs
index 085dfc6c699d..ffa0424349bb 100644
--- a/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs
+++ b/src/Files.App.Controls/BladeView/BladeViewAutomationPeer.cs
@@ -1,13 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Automation;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.UI.Xaml.Automation.Peers;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarLayout.cs b/src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarLayout.cs
index f1a0d2efcc25..42f107a96712 100644
--- a/src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarLayout.cs
+++ b/src/Files.App.Controls/BreadcrumbBar/BreadcrumbBarLayout.cs
@@ -41,7 +41,7 @@ protected override Size MeasureOverride(NonVirtualizingLayoutContext context, Si
if (context.Children[index] is BreadcrumbBarItem breadcrumbItem)
{
breadcrumbItem.Measure(availableSize);
- accumulatedSize.Width += index < indexAfterEllipsis ? 0: breadcrumbItem.DesiredSize.Width;
+ accumulatedSize.Width += index < indexAfterEllipsis ? 0 : breadcrumbItem.DesiredSize.Width;
accumulatedSize.Height = Math.Max(accumulatedSize.Height, breadcrumbItem.DesiredSize.Height);
}
}
diff --git a/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs b/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs
index 353e46c3b035..99e8579595e9 100644
--- a/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs
+++ b/src/Files.App.Controls/GridSplitter/GripperHoverWrapper.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.UI.Input;
-using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/SamplePanel/SamplePanel.Properties.cs b/src/Files.App.Controls/SamplePanel/SamplePanel.Properties.cs
index 99ff6328a8c0..c187fbf1111b 100644
--- a/src/Files.App.Controls/SamplePanel/SamplePanel.Properties.cs
+++ b/src/Files.App.Controls/SamplePanel/SamplePanel.Properties.cs
@@ -2,8 +2,6 @@
// Licensed under the MIT License.
using CommunityToolkit.WinUI;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/SamplePanel/SamplePanel.cs b/src/Files.App.Controls/SamplePanel/SamplePanel.cs
index 9b727cb2a0bf..8d2dbc1ff2e0 100644
--- a/src/Files.App.Controls/SamplePanel/SamplePanel.cs
+++ b/src/Files.App.Controls/SamplePanel/SamplePanel.cs
@@ -1,10 +1,6 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Markup;
-
namespace Files.App.Controls
{
// Visual states
diff --git a/src/Files.App.Controls/Sidebar/ISidebarViewModel.cs b/src/Files.App.Controls/Sidebar/ISidebarViewModel.cs
index eb35d2ece37e..a3673e6d6105 100644
--- a/src/Files.App.Controls/Sidebar/ISidebarViewModel.cs
+++ b/src/Files.App.Controls/Sidebar/ISidebarViewModel.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using Microsoft.UI.Input;
-using Microsoft.UI.Xaml;
using Windows.ApplicationModel.DataTransfer;
using Windows.Foundation;
diff --git a/src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs b/src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs
index 68b1d440c126..79a336758fca 100644
--- a/src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs
+++ b/src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs
@@ -44,7 +44,7 @@ public double ChildrenPresenterHeight
}
// Using 30 as a default in case something goes wrong
public static readonly DependencyProperty ChildrenPresenterHeightProperty =
- DependencyProperty.Register(nameof(ChildrenPresenterHeight), typeof(double), typeof(SidebarItem), new PropertyMetadata(30d));
+ DependencyProperty.Register(nameof(ChildrenPresenterHeight), typeof(double), typeof(SidebarItem), new PropertyMetadata(30d));
public ISidebarItemModel? Item
{
@@ -112,7 +112,7 @@ public static void OnPropertyChanged(DependencyObject sender, DependencyProperty
{
item.UpdateExpansionState();
}
- else if(e.Property == ItemProperty)
+ else if (e.Property == ItemProperty)
{
item.HandleItemChange();
}
diff --git a/src/Files.App.Controls/Storage/RingShape/RingShape.Properties.cs b/src/Files.App.Controls/Storage/RingShape/RingShape.Properties.cs
index d85ff577f316..2d6680a3115b 100644
--- a/src/Files.App.Controls/Storage/RingShape/RingShape.Properties.cs
+++ b/src/Files.App.Controls/Storage/RingShape/RingShape.Properties.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using CommunityToolkit.WinUI;
-using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
using Windows.Foundation;
diff --git a/src/Files.App.Controls/Storage/StorageBar/StorageBar.cs b/src/Files.App.Controls/Storage/StorageBar/StorageBar.cs
index 236f74f080b8..d570cc88d1fa 100644
--- a/src/Files.App.Controls/Storage/StorageBar/StorageBar.cs
+++ b/src/Files.App.Controls/Storage/StorageBar/StorageBar.cs
@@ -217,7 +217,7 @@ private void UpdateColumnWidths()
true);
var interpolatedGapWidth = valueLarger
- ? StorageControlsHelpers.CalculateInterpolatedValue(
+ ? StorageControlsHelpers.CalculateInterpolatedValue(
minPercent,
Percent,
minPercent + 2.0,
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Consts.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Consts.cs
index 5cc349e20ef9..3de66bb5294c 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Consts.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Consts.cs
@@ -1,9 +1,6 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-
namespace Files.App.Controls
{
// Template Parts
@@ -12,7 +9,7 @@ namespace Files.App.Controls
[TemplatePart(Name = LayeredPathIconViewBox, Type = typeof(Viewbox))]
[TemplatePart(Name = LayeredPathCanvas, Type = typeof(Canvas))]
// Icon Type Visual States
- [TemplateVisualState(Name = OutlineTypeStateName, GroupName = IconTypeStateGroupName)]
+ [TemplateVisualState(Name = OutlineTypeStateName, GroupName = IconTypeStateGroupName)]
[TemplateVisualState(Name = LayeredTypeStateName, GroupName = IconTypeStateGroupName)]
[TemplateVisualState(Name = FilledTypeStateName, GroupName = IconTypeStateGroupName)]
// Icon Color Visual States
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs
index 3a87ce1efc43..52572e76381f 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Owner.cs
@@ -2,9 +2,6 @@
// Licensed under the MIT License.
using CommunityToolkit.WinUI;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Controls.Primitives;
namespace Files.App.Controls
{
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Properties.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Properties.cs
index f72caa7a414e..c385aab30c6c 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.Properties.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.Properties.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT License.
using CommunityToolkit.WinUI;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs
index a42168104c90..c7cfdde8932f 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs
@@ -1,13 +1,9 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Markup;
+using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
-using System.Linq;
-using System.Collections.Generic;
namespace Files.App.Controls
{
@@ -15,11 +11,11 @@ namespace Files.App.Controls
/// A control for a State and Color aware Icon
///
public partial class ThemedIcon : Control
- {
- private Viewbox? _filledViewBox;
- private Viewbox? _outlineViewBox;
- private Viewbox? _layeredViewBox;
- private Canvas? _layeredCanvas;
+ {
+ private Viewbox? _filledViewBox;
+ private Viewbox? _outlineViewBox;
+ private Viewbox? _layeredViewBox;
+ private Canvas? _layeredCanvas;
public ThemedIcon()
{
@@ -49,11 +45,11 @@ protected override void OnApplyTemplate()
private void GetTemplateParts()
{
// Gets the template parts and sets the private fields
- _outlineViewBox = GetTemplateChild( OutlinePathIconViewBox ) as Viewbox;
- _filledViewBox = GetTemplateChild( FilledPathIconViewBox ) as Viewbox;
- _layeredViewBox = GetTemplateChild( LayeredPathIconViewBox ) as Viewbox;
+ _outlineViewBox = GetTemplateChild(OutlinePathIconViewBox) as Viewbox;
+ _filledViewBox = GetTemplateChild(FilledPathIconViewBox) as Viewbox;
+ _layeredViewBox = GetTemplateChild(LayeredPathIconViewBox) as Viewbox;
- _layeredCanvas = GetTemplateChild( LayeredPathCanvas ) as Canvas;
+ _layeredCanvas = GetTemplateChild(LayeredPathCanvas) as Canvas;
}
// Updates paths and layers
@@ -64,7 +60,7 @@ private void OnFilledIconChanged()
if (_filledViewBox == null)
return;
- SetPathData(FilledIconPath, FilledIconData ?? string.Empty, _filledViewBox );
+ SetPathData(FilledIconPath, FilledIconData ?? string.Empty, _filledViewBox);
}
private void OnOutlineIconChanged()
@@ -73,16 +69,16 @@ private void OnOutlineIconChanged()
if (_outlineViewBox == null)
return;
- SetPathData(OutlineIconPath, OutlineIconData ?? string.Empty, _outlineViewBox );
+ SetPathData(OutlineIconPath, OutlineIconData ?? string.Empty, _outlineViewBox);
}
private void OnLayeredIconChanged()
{
// Updates Layered Icon from it's Layers
- if ( _layeredViewBox == null ||
+ if (_layeredViewBox == null ||
_layeredCanvas == null ||
Layers is not ICollection layers)
- return;
+ return;
_layeredCanvas.Children.Clear();
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.Consts.cs b/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.Consts.cs
index 99abf1cdd354..137eed61a5ed 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.Consts.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.Consts.cs
@@ -1,8 +1,6 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Shapes;
namespace Files.App.Controls
diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.cs b/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.cs
index 5a8c73be4869..5e1b52444b33 100644
--- a/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.cs
+++ b/src/Files.App.Controls/ThemedIcon/ThemedIconLayer/ThemedIconLayer.cs
@@ -1,8 +1,6 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
@@ -68,8 +66,8 @@ private void UpdateIconLayerState()
IconColorType switch
{
ThemedIconColorType.Critical => CriticalStateName,
- ThemedIconColorType.Caution => CautionStateName,
- ThemedIconColorType.Success => SuccessStateName,
+ ThemedIconColorType.Caution => CautionStateName,
+ ThemedIconColorType.Success => SuccessStateName,
ThemedIconColorType.Neutral => NeutralStateName,
ThemedIconColorType.Custom => CustomColorStateName,
_ => AccentStateName,
diff --git a/src/Files.App.Controls/Toolbar/Primitives/ToolbarLayout.cs b/src/Files.App.Controls/Toolbar/Primitives/ToolbarLayout.cs
index d6bac7137dec..cf91d1a0bbda 100644
--- a/src/Files.App.Controls/Toolbar/Primitives/ToolbarLayout.cs
+++ b/src/Files.App.Controls/Toolbar/Primitives/ToolbarLayout.cs
@@ -1,8 +1,6 @@
// Copyright (c) Files Community
// Licensed under the MIT License.
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
using Windows.Foundation;
namespace Files.App.Controls.Primitives
@@ -21,14 +19,14 @@ private int GetItemCount(NonVirtualizingLayoutContext context)
return context.Children.Count;
}
- private UIElement GetElementAt(NonVirtualizingLayoutContext context , int index)
+ private UIElement GetElementAt(NonVirtualizingLayoutContext context, int index)
{
return context.Children[index];
}
// Measuring is performed in a single step, every element is measured, including the overflow button
// item, but the total amount of space needed is only composed of the Toolbar Items
- protected override Size MeasureOverride(NonVirtualizingLayoutContext context , Size availableSize)
+ protected override Size MeasureOverride(NonVirtualizingLayoutContext context, Size availableSize)
{
m_availableSize = availableSize;
@@ -39,32 +37,32 @@ protected override Size MeasureOverride(NonVirtualizingLayoutContext context , S
//var toolbarItem = (ToolbarItem)GetElementAt(context, i);
//toolbarItem.Measure( availableSize );
- if ( i != 0 )
+ if (i != 0)
{
//accumulatedItemsSize.Width += toolbarItem.DesiredSize.Width;
//accumulatedItemsSize.Height = Math.Max( accumulatedItemsSize.Height , toolbarItem.DesiredSize.Height );
}
}
- if ( accumulatedItemsSize.Width > availableSize.Width )
+ if (accumulatedItemsSize.Width > availableSize.Width)
{
-
+
}
else
{
-
+
}
return accumulatedItemsSize;
}
- private void ArrangeItem(UIElement breadcrumbItem , ref float accumulatedWidths , float maxElementHeight)
+ private void ArrangeItem(UIElement breadcrumbItem, ref float accumulatedWidths, float maxElementHeight)
{
}
// Arranging is performed in a single step, as many elements are tried to be drawn going from the last element
// towards the first one, if there's not enough space, then the ellipsis button is drawn
- protected override Size ArrangeOverride(NonVirtualizingLayoutContext context , Size finalSize)
+ protected override Size ArrangeOverride(NonVirtualizingLayoutContext context, Size finalSize)
{
return finalSize;
}
diff --git a/src/Files.App.Controls/Toolbar/Toolbar.Constants.cs b/src/Files.App.Controls/Toolbar/Toolbar.Constants.cs
index bb1c2cab030f..044eeaa6d083 100644
--- a/src/Files.App.Controls/Toolbar/Toolbar.Constants.cs
+++ b/src/Files.App.Controls/Toolbar/Toolbar.Constants.cs
@@ -4,30 +4,30 @@
namespace Files.App.Controls
{
// TemplateParts
- [TemplatePart( Name = ToolbarItemsRepeaterPartName , Type = typeof( ItemsRepeater ) )]
+ [TemplatePart(Name = ToolbarItemsRepeaterPartName, Type = typeof(ItemsRepeater))]
// VisualStates
- [TemplateVisualState( Name = OverflowOnStateName , GroupName = CommonStatesGroupName )]
- [TemplateVisualState( Name = OverflowOffStateName , GroupName = CommonStatesGroupName )]
+ [TemplateVisualState(Name = OverflowOnStateName, GroupName = CommonStatesGroupName)]
+ [TemplateVisualState(Name = OverflowOffStateName, GroupName = CommonStatesGroupName)]
public partial class Toolbar : Control
{
// TemplatePart Names
- internal const string ToolbarItemsRepeaterPartName = "PART_ItemsRepeater";
+ internal const string ToolbarItemsRepeaterPartName = "PART_ItemsRepeater";
// VisualState Group Names
- internal const string CommonStatesGroupName = "OverflowStates";
+ internal const string CommonStatesGroupName = "OverflowStates";
// VisualState Names
- internal const string OverflowOnStateName = "OverflowOn";
- internal const string OverflowOffStateName = "OverflowOff";
+ internal const string OverflowOnStateName = "OverflowOn";
+ internal const string OverflowOffStateName = "OverflowOff";
// ResourceDictionary Keys
- internal const string SmallMinWidthResourceKey = "ToolbarButtonSmallMinWidth";
- internal const string SmallMinHeightResourceKey = "ToolbarButtonSmallMinHeight";
+ internal const string SmallMinWidthResourceKey = "ToolbarButtonSmallMinWidth";
+ internal const string SmallMinHeightResourceKey = "ToolbarButtonSmallMinHeight";
- internal const string MediumMinWidthResourceKey = "ToolbarButtonMediumMinWidth";
- internal const string MediumMinHeightResourceKey = "ToolbarButtonMediumMinHeight";
+ internal const string MediumMinWidthResourceKey = "ToolbarButtonMediumMinWidth";
+ internal const string MediumMinHeightResourceKey = "ToolbarButtonMediumMinHeight";
- internal const string LargeMinWidthResourceKey = "ToolbarButtonLargeMinWidth";
- internal const string LargeMinHeightResourceKey = "ToolbarButtonLargeMinHeight";
+ internal const string LargeMinWidthResourceKey = "ToolbarButtonLargeMinWidth";
+ internal const string LargeMinHeightResourceKey = "ToolbarButtonLargeMinHeight";
}
}
diff --git a/src/Files.App.Controls/Toolbar/Toolbar.Properties.cs b/src/Files.App.Controls/Toolbar/Toolbar.Properties.cs
index c2a76e85d066..e58e36f4aff7 100644
--- a/src/Files.App.Controls/Toolbar/Toolbar.Properties.cs
+++ b/src/Files.App.Controls/Toolbar/Toolbar.Properties.cs
@@ -24,8 +24,8 @@ public partial class Toolbar : Control
///
public ToolbarSizes ToolbarSize
{
- get => (ToolbarSizes)GetValue( ToolbarSizeProperty );
- set => SetValue( ToolbarSizeProperty , value );
+ get => (ToolbarSizes)GetValue(ToolbarSizeProperty);
+ set => SetValue(ToolbarSizeProperty, value);
}
@@ -34,11 +34,11 @@ public ToolbarSizes ToolbarSize
///
///
///
- protected virtual void OnToolbarSizePropertyChanged(ToolbarSizes oldValue , ToolbarSizes newValue)
+ protected virtual void OnToolbarSizePropertyChanged(ToolbarSizes oldValue, ToolbarSizes newValue)
{
- if ( newValue != oldValue )
+ if (newValue != oldValue)
{
- ToolbarSizeChanged( newValue );
+ ToolbarSizeChanged(newValue);
}
}
@@ -48,26 +48,26 @@ protected virtual void OnToolbarSizePropertyChanged(ToolbarSizes oldValue , Tool
public static readonly DependencyProperty ItemsProperty =
DependencyProperty.Register(
- nameof( Items ),
- typeof( IList ),
- typeof(Toolbar),
- new PropertyMetadata( defaultValue: new List(), (d, e) => ((Toolbar)d).OnItemsPropertyChanged(( IList )e.OldValue, ( IList )e.NewValue)));
+ nameof(Items),
+ typeof(IList),
+ typeof(Toolbar),
+ new PropertyMetadata(defaultValue: new List(), (d, e) => ((Toolbar)d).OnItemsPropertyChanged((IList)e.OldValue, (IList)e.NewValue)));
public IList Items
{
- get => ( IList )GetValue( ItemsProperty );
- set => SetValue( ItemsProperty , value );
+ get => (IList)GetValue(ItemsProperty);
+ set => SetValue(ItemsProperty, value);
}
- private void OnItemsPropertyChanged(IList oldItems , IList newItems)
+ private void OnItemsPropertyChanged(IList oldItems, IList newItems)
{
- if ( newItems != oldItems )
+ if (newItems != oldItems)
{
- ItemsChanged( newItems );
+ ItemsChanged(newItems);
}
}
@@ -92,8 +92,8 @@ private void OnItemsPropertyChanged(IList oldItems , IList
public DataTemplate ItemTemplate
{
- get => (DataTemplate)GetValue( ItemTemplateProperty );
- set => SetValue( ItemTemplateProperty , value );
+ get => (DataTemplate)GetValue(ItemTemplateProperty);
+ set => SetValue(ItemTemplateProperty, value);
}
@@ -102,11 +102,11 @@ public DataTemplate ItemTemplate
///
///
///
- protected virtual void OnItemTemplatePropertyChanged(DataTemplate oldValue , DataTemplate newValue)
+ protected virtual void OnItemTemplatePropertyChanged(DataTemplate oldValue, DataTemplate newValue)
{
- if ( newValue != oldValue )
+ if (newValue != oldValue)
{
- ItemTemplateChanged( newValue );
+ ItemTemplateChanged(newValue);
}
}
@@ -122,7 +122,7 @@ protected virtual void OnItemTemplatePropertyChanged(DataTemplate oldValue , Dat
nameof(ItemList),
typeof(ToolbarItemList),
typeof(Toolbar),
- new PropertyMetadata(new ToolbarItemList(), (d, e) => ((Toolbar)d).OnItemListPropertyChanged(( ToolbarItemList )e.OldValue, ( ToolbarItemList )e.NewValue)));
+ new PropertyMetadata(new ToolbarItemList(), (d, e) => ((Toolbar)d).OnItemListPropertyChanged((ToolbarItemList)e.OldValue, (ToolbarItemList)e.NewValue)));
@@ -131,17 +131,17 @@ protected virtual void OnItemTemplatePropertyChanged(DataTemplate oldValue , Dat
///
private ToolbarItemList ItemList
{
- get { return (ToolbarItemList)GetValue( ItemListProperty ); }
- set { SetValue( ItemListProperty , value ); }
+ get { return (ToolbarItemList)GetValue(ItemListProperty); }
+ set { SetValue(ItemListProperty, value); }
}
- private void OnItemListPropertyChanged(ToolbarItemList oldList , ToolbarItemList newList)
+ private void OnItemListPropertyChanged(ToolbarItemList oldList, ToolbarItemList newList)
{
- if ( newList != oldList )
+ if (newList != oldList)
{
- PrivateItemListChanged( newList );
+ PrivateItemListChanged(newList);
}
}
#endregion
@@ -156,7 +156,7 @@ private void OnItemListPropertyChanged(ToolbarItemList oldList , ToolbarItemList
nameof(ItemOverflowList),
typeof(ToolbarItemOverflowList),
typeof(Toolbar),
- new PropertyMetadata(new ToolbarItemOverflowList(), (d, e) => ((Toolbar)d).OnItemOverflowListPropertyChanged(( ToolbarItemOverflowList )e.OldValue, ( ToolbarItemOverflowList )e.NewValue)));
+ new PropertyMetadata(new ToolbarItemOverflowList(), (d, e) => ((Toolbar)d).OnItemOverflowListPropertyChanged((ToolbarItemOverflowList)e.OldValue, (ToolbarItemOverflowList)e.NewValue)));
@@ -165,17 +165,17 @@ private void OnItemListPropertyChanged(ToolbarItemList oldList , ToolbarItemList
///
private ToolbarItemOverflowList ItemOverflowList
{
- get { return (ToolbarItemOverflowList)GetValue( ItemOverflowListProperty ); }
- set { SetValue( ItemOverflowListProperty , value ); }
+ get { return (ToolbarItemOverflowList)GetValue(ItemOverflowListProperty); }
+ set { SetValue(ItemOverflowListProperty, value); }
}
- private void OnItemOverflowListPropertyChanged(ToolbarItemOverflowList oldList , ToolbarItemOverflowList newList)
+ private void OnItemOverflowListPropertyChanged(ToolbarItemOverflowList oldList, ToolbarItemOverflowList newList)
{
- if ( newList != oldList )
+ if (newList != oldList)
{
- PrivateItemOverflowListChanged( newList );
+ PrivateItemOverflowListChanged(newList);
}
}
#endregion
diff --git a/src/Files.App.Controls/Toolbar/Toolbar.cs b/src/Files.App.Controls/Toolbar/Toolbar.cs
index 2d10d6910c18..28b0fb69db02 100644
--- a/src/Files.App.Controls/Toolbar/Toolbar.cs
+++ b/src/Files.App.Controls/Toolbar/Toolbar.cs
@@ -8,28 +8,28 @@ public partial class Toolbar : Control
// A reference to the current available size for ToolbarItems
private double _availableSize;
- private ItemsRepeater? _itemsRepeater;
- private ToolbarItemList? _toolbarItemsList;
- private ToolbarItemOverflowList? _toolbarItemsOverflowList;
+ private ItemsRepeater? _itemsRepeater;
+ private ToolbarItemList? _toolbarItemsList;
+ private ToolbarItemOverflowList? _toolbarItemsOverflowList;
- private ToolbarItemList _tempToolbarItemsList;
- private ToolbarItemOverflowList _tempToolbarItemsOverflowList;
+ private ToolbarItemList _tempToolbarItemsList;
+ private ToolbarItemOverflowList _tempToolbarItemsOverflowList;
- private double _smallMinWidth = 24; // I have set default values, but we pull from resources
- private double _mediumMinWidth = 32; // if they are available.
- private double _largeMinWidth = 32;
-
- private double _smallMinHeight = 24;
- private double _mediumMinHeight = 24;
- private double _largeMinHeight = 32;
+ private double _smallMinWidth = 24; // I have set default values, but we pull from resources
+ private double _mediumMinWidth = 32; // if they are available.
+ private double _largeMinWidth = 32;
- private double _currentMinWidth;
- private double _currentMinHeight;
+ private double _smallMinHeight = 24;
+ private double _mediumMinHeight = 24;
+ private double _largeMinHeight = 32;
+
+ private double _currentMinWidth;
+ private double _currentMinHeight;
public Toolbar()
{
- DefaultStyleKey = typeof( Toolbar );
+ DefaultStyleKey = typeof(Toolbar);
}
protected override void OnApplyTemplate()
@@ -38,17 +38,17 @@ protected override void OnApplyTemplate()
UpdateMinSizesFromResources();
- if ( Items != null )
+ if (Items != null)
{
_tempToolbarItemsList = new ToolbarItemList();
_tempToolbarItemsOverflowList = new ToolbarItemOverflowList();
- UpdateItems( Items );
+ UpdateItems(Items);
}
- SetItemsRepeater( GetTemplateChild( ToolbarItemsRepeaterPartName ) as ItemsRepeater );
+ SetItemsRepeater(GetTemplateChild(ToolbarItemsRepeaterPartName) as ItemsRepeater);
- if ( GetItemsRepeater() != null )
+ if (GetItemsRepeater() != null)
{
ItemsRepeater itemsRepeater = GetItemsRepeater();
itemsRepeater.ItemsSource = GetToolbarItemsList();
@@ -201,17 +201,17 @@ private void UpdateItems(IList newItems)
/// manage the Buttons and the Menu items
///
- foreach ( var item in newItems )
+ foreach (var item in newItems)
{
- SortItemsByOverflowBehavior( item );
- Debug.Write( "-> Sorted " + item.Label + " from Items... ..." + Environment.NewLine );
+ SortItemsByOverflowBehavior(item);
+ Debug.Write("-> Sorted " + item.Label + " from Items... ..." + Environment.NewLine);
}
- UpdatePrivateItemList( _tempToolbarItemsList );
- Debug.Write( " | tempItemsList " + _tempToolbarItemsList.Count.ToString() + " *" + Environment.NewLine );
+ UpdatePrivateItemList(_tempToolbarItemsList);
+ Debug.Write(" | tempItemsList " + _tempToolbarItemsList.Count.ToString() + " *" + Environment.NewLine);
- UpdatePrivateItemOverflowList( _tempToolbarItemsOverflowList );
- Debug.Write( " | tempItemsOverflowList " + _tempToolbarItemsOverflowList.Count.ToString() + " *" + Environment.NewLine );
+ UpdatePrivateItemOverflowList(_tempToolbarItemsOverflowList);
+ Debug.Write(" | tempItemsOverflowList " + _tempToolbarItemsOverflowList.Count.ToString() + " *" + Environment.NewLine);
}
@@ -225,9 +225,9 @@ private void UpdateItemTemplate(DataTemplate newDataTemplate)
- private void UpdateToolbarSize( ToolbarSizes newToolbarSize )
+ private void UpdateToolbarSize(ToolbarSizes newToolbarSize)
{
- UpdateMinSizesFromResources();
+ UpdateMinSizesFromResources();
}
@@ -239,7 +239,7 @@ private void UpdateAvailableSize()
// Do some code to check or respond to size changes for
// the Toolbar's Items space (ItemsRepeaterLayout?)
- SetAvailableSize( newAvailableSize );
+ SetAvailableSize(newAvailableSize);
/// We need to check the Item Widths and Heights
/// (we know the sizes for buttons, but content will need
@@ -256,43 +256,43 @@ private void UpdateAvailableSize()
///
private void UpdateMinSizesFromResources()
{
- double smallMinWidth = (double)Application.Current.Resources[SmallMinWidthResourceKey];
- double smallMinHeight = (double)Application.Current.Resources[SmallMinHeightResourceKey];
+ double smallMinWidth = (double)Application.Current.Resources[SmallMinWidthResourceKey];
+ double smallMinHeight = (double)Application.Current.Resources[SmallMinHeightResourceKey];
- double mediumMinWidth = (double)Application.Current.Resources[MediumMinWidthResourceKey];
- double mediumMinHeight = (double)Application.Current.Resources[MediumMinHeightResourceKey];
+ double mediumMinWidth = (double)Application.Current.Resources[MediumMinWidthResourceKey];
+ double mediumMinHeight = (double)Application.Current.Resources[MediumMinHeightResourceKey];
- double largeMinWidth = (double)Application.Current.Resources[LargeMinWidthResourceKey];
- double largeMinHeight = (double)Application.Current.Resources[LargeMinHeightResourceKey];
+ double largeMinWidth = (double)Application.Current.Resources[LargeMinWidthResourceKey];
+ double largeMinHeight = (double)Application.Current.Resources[LargeMinHeightResourceKey];
- if ( !double.IsNaN( smallMinWidth ) || !double.IsNaN( smallMinHeight ) ||
- !double.IsNaN( mediumMinWidth ) || !double.IsNaN( mediumMinHeight ) ||
- !double.IsNaN( largeMinWidth ) || !double.IsNaN( largeMinHeight ) )
+ if (!double.IsNaN(smallMinWidth) || !double.IsNaN(smallMinHeight) ||
+ !double.IsNaN(mediumMinWidth) || !double.IsNaN(mediumMinHeight) ||
+ !double.IsNaN(largeMinWidth) || !double.IsNaN(largeMinHeight))
{
- SetSmallMinWidth( smallMinWidth );
- SetSmallMinHeight( smallMinHeight );
+ SetSmallMinWidth(smallMinWidth);
+ SetSmallMinHeight(smallMinHeight);
- SetMediumMinWidth( mediumMinWidth );
- SetMediumMinHeight( mediumMinHeight );
+ SetMediumMinWidth(mediumMinWidth);
+ SetMediumMinHeight(mediumMinHeight);
- SetLargeMinWidth( largeMinWidth );
- SetLargeMinHeight( largeMinHeight );
+ SetLargeMinWidth(largeMinWidth);
+ SetLargeMinHeight(largeMinHeight);
}
- if ( ToolbarSize == ToolbarSizes.Small )
+ if (ToolbarSize == ToolbarSizes.Small)
{
- SetCurrentMinWidth( GetSmallMinWidth() );
- SetCurrentMinHeight( GetSmallMinHeight() );
+ SetCurrentMinWidth(GetSmallMinWidth());
+ SetCurrentMinHeight(GetSmallMinHeight());
}
- else if ( ToolbarSize == ToolbarSizes.Large )
+ else if (ToolbarSize == ToolbarSizes.Large)
{
- SetCurrentMinWidth( GetLargeMinWidth() );
- SetCurrentMinHeight( GetLargeMinHeight() );
+ SetCurrentMinWidth(GetLargeMinWidth());
+ SetCurrentMinHeight(GetLargeMinHeight());
}
else
{
- SetCurrentMinWidth( GetMediumMinWidth() );
- SetCurrentMinHeight( GetMediumMinHeight() );
+ SetCurrentMinWidth(GetMediumMinWidth());
+ SetCurrentMinHeight(GetMediumMinHeight());
}
}
@@ -304,7 +304,7 @@ private void UpdateMinSizesFromResources()
///
private void UpdatePrivateItemList(ToolbarItemList newList)
{
- SetToolbarItemsList( newList );
+ SetToolbarItemsList(newList);
}
@@ -315,7 +315,7 @@ private void UpdatePrivateItemList(ToolbarItemList newList)
///
private void UpdatePrivateItemOverflowList(ToolbarItemOverflowList newOverflowList)
{
- SetToolbarItemsOverflowList( newOverflowList );
+ SetToolbarItemsOverflowList(newOverflowList);
}
#endregion
@@ -328,7 +328,7 @@ private void UpdatePrivateItemOverflowList(ToolbarItemOverflowList newOverflowLi
///
private void ItemsChanged(IList newItems)
{
- UpdateItems( newItems );
+ UpdateItems(newItems);
}
@@ -339,7 +339,7 @@ private void ItemsChanged(IList newItems)
///
private void ItemTemplateChanged(DataTemplate newDataTemplate)
{
- UpdateItemTemplate( newDataTemplate );
+ UpdateItemTemplate(newDataTemplate);
}
@@ -350,7 +350,7 @@ private void ItemTemplateChanged(DataTemplate newDataTemplate)
///
private void ToolbarSizeChanged(ToolbarSizes newToolbarSize)
{
- UpdateToolbarSize( newToolbarSize );
+ UpdateToolbarSize(newToolbarSize);
}
@@ -361,7 +361,7 @@ private void ToolbarSizeChanged(ToolbarSizes newToolbarSize)
///
private void PrivateItemListChanged(ToolbarItemList newList)
{
- UpdatePrivateItemList( newList );
+ UpdatePrivateItemList(newList);
}
@@ -372,7 +372,7 @@ private void PrivateItemListChanged(ToolbarItemList newList)
///
private void PrivateItemOverflowListChanged(ToolbarItemOverflowList newOverflowList)
{
- UpdatePrivateItemOverflowList( newOverflowList );
+ UpdatePrivateItemOverflowList(newOverflowList);
}
#endregion
@@ -390,18 +390,18 @@ private void SortItemsByOverflowBehavior(ToolbarItem item)
/// Then we pass that item through additional sorting and
/// then add the relevant control to the lists.
///
- if ( item != null )
+ if (item != null)
{
- if ( item.OverflowBehavior == OverflowBehaviors.Always )
+ if (item.OverflowBehavior == OverflowBehaviors.Always)
{
- AddItemToOverflowList( SortByItemTypeForOverflowItemList( item ) );
+ AddItemToOverflowList(SortByItemTypeForOverflowItemList(item));
}
else
{
/// Not sure if we check for space at this point, or
/// When we are adding items to the Private ItemList
///
- if ( item.OverflowBehavior == OverflowBehaviors.Never )
+ if (item.OverflowBehavior == OverflowBehaviors.Never)
{
/// Not sure if we need to behave differently at
/// this stage for the items, but we can do if
@@ -414,7 +414,7 @@ private void SortItemsByOverflowBehavior(ToolbarItem item)
//AddItemToItemList( SortByItemTypeForItemList( item ) );
}
- AddItemToItemList( SortByItemTypeForItemList( item ) );
+ AddItemToItemList(SortByItemTypeForItemList(item));
}
}
}
@@ -428,11 +428,11 @@ private void SortItemsByOverflowBehavior(ToolbarItem item)
///
private IToolbarItemSet SortByItemTypeForItemList(ToolbarItem item)
{
- switch ( item.ItemType )
+ switch (item.ItemType)
{
case ToolbarItemTypes.Button:
// Add ToolbarButton
- return CreateToolbarButton( item.Label , item.ThemedIcon , GetCurrentMinWidth() , GetCurrentMinHeight() , item.IconSize );
+ return CreateToolbarButton(item.Label, item.ThemedIcon, GetCurrentMinWidth(), GetCurrentMinHeight(), item.IconSize);
case ToolbarItemTypes.FlyoutButton:
// Add ToolbarFlyoutButton
@@ -448,7 +448,7 @@ private IToolbarItemSet SortByItemTypeForItemList(ToolbarItem item)
case ToolbarItemTypes.ToggleButton:
// Add ToolbarToggleButton
- return CreateToolbarToggleButton( item.Label , item.ThemedIcon , GetCurrentMinWidth() , GetCurrentMinHeight() , item.IconSize , item.IsChecked );
+ return CreateToolbarToggleButton(item.Label, item.ThemedIcon, GetCurrentMinWidth(), GetCurrentMinHeight(), item.IconSize, item.IsChecked);
case ToolbarItemTypes.Separator:
// Add ToolbarToggleButton
@@ -472,7 +472,7 @@ private IToolbarItemSet SortByItemTypeForItemList(ToolbarItem item)
///
private IToolbarOverflowItemSet SortByItemTypeForOverflowItemList(ToolbarItem item)
{
- switch ( item.ItemType )
+ switch (item.ItemType)
{
case ToolbarItemTypes.Button:
// Add MenuFlyoutItemEx
@@ -528,47 +528,51 @@ private void PopulateItemsSourceForItemsRepeater()
ItemsRepeater itemsRepeater = GetItemsRepeater();
- foreach ( ToolbarItem item in GetToolbarItemsList() )
+ foreach (ToolbarItem item in GetToolbarItemsList())
{
/// We can get the AvailableSize
///
- double availableSize = GetAvailableSize();
+ double availableSize = GetAvailableSize();
ObservableCollection