From 5dadc640c2db9d9b1d50d578d7c322ab07896ffe Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 11:31:42 -0600 Subject: [PATCH 01/11] Bump uno.check version to 1.27.4 --- .config/dotnet-tools.json | 2 +- tooling | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3b3d280a..69c13801 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "uno.check": { - "version": "1.20.2", + "version": "1.27.4", "commands": [ "uno-check" ] diff --git a/tooling b/tooling index 93931e0b..81a7ceed 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit 93931e0beda3520fcc68e8bf9975a4ebb7067674 +Subproject commit 81a7ceed33be91b35dbf541b166de7e2d382494c From 847185f8a66ab54da8219e7eb51b7f3217e63bf1 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 13:34:29 -0600 Subject: [PATCH 02/11] Added missing XML doc comments --- .../src/Headers/FadeHeaderBehavior.cs | 3 +++ .../src/Headers/HeaderBehaviorBase.cs | 15 +++++++++++ .../src/SwitchPresenter/SwitchConverter.cs | 6 +++++ .../src/SwitchPresenter/SwitchHelpers.cs | 1 + components/Segmented/src/EqualPanel.cs | 12 +++++++++ .../src/Helpers/SegmentedMarginConverter.cs | 5 ++++ .../Segmented/src/Segmented/Segmented.cs | 19 ++++++++++++++ .../src/SegmentedItem/SegmentedItem.cs | 13 ++++++++++ .../src/Helpers/StyleExtensions.cs | 16 +++++++++++- .../SettingsCard/SettingsCard.Properties.cs | 21 +++++++++++++++ .../src/SettingsCard/SettingsCard.cs | 12 +++++++++ .../SettingsCardAutomationPeer.cs | 1 + .../SettingsExpander.ItemsControl.cs | 26 +++++++++++++++++++ .../SettingsExpander.Properties.cs | 2 ++ .../src/SettingsExpander/SettingsExpander.cs | 3 +++ .../SettingsExpanderAutomationPeer.cs | 1 + .../src/TokenizingTextBox.cs | 3 +++ .../Triggers/src/IsNullOrEmptyStateTrigger.cs | 3 +++ 18 files changed, 161 insertions(+), 1 deletion(-) diff --git a/components/Behaviors/src/Headers/FadeHeaderBehavior.cs b/components/Behaviors/src/Headers/FadeHeaderBehavior.cs index a9ca7c34..17aa5404 100644 --- a/components/Behaviors/src/Headers/FadeHeaderBehavior.cs +++ b/components/Behaviors/src/Headers/FadeHeaderBehavior.cs @@ -46,6 +46,9 @@ protected override bool AssignAnimation() return false; } + /// + /// Stops the animation. + /// protected override void StopAnimation() { if (_headerVisual != null) diff --git a/components/Behaviors/src/Headers/HeaderBehaviorBase.cs b/components/Behaviors/src/Headers/HeaderBehaviorBase.cs index 126223ac..57b1c375 100644 --- a/components/Behaviors/src/Headers/HeaderBehaviorBase.cs +++ b/components/Behaviors/src/Headers/HeaderBehaviorBase.cs @@ -22,9 +22,24 @@ public abstract class HeaderBehaviorBase : BehaviorBase // From Doc: https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.canvas.zindex private const int CanvasZIndexMax = 1_000_000; + /// + /// The ScrollViewer associated with the ListViewBase control. + /// protected ScrollViewer? _scrollViewer; + + /// + /// The CompositionPropertySet associated with the ScrollViewer. + /// protected CompositionPropertySet? _scrollProperties; + + /// + /// The CompositionPropertySet associated with the animation. + /// protected CompositionPropertySet? _animationProperties; + + /// + /// The Visual associated with the header element. + /// protected Visual? _headerVisual; /// diff --git a/components/Primitives/src/SwitchPresenter/SwitchConverter.cs b/components/Primitives/src/SwitchPresenter/SwitchConverter.cs index 7ce8bad2..e64009b2 100644 --- a/components/Primitives/src/SwitchPresenter/SwitchConverter.cs +++ b/components/Primitives/src/SwitchPresenter/SwitchConverter.cs @@ -66,6 +66,9 @@ public SwitchConverter() SwitchCases = new CaseCollection(); } + /// + /// Converts the provided value based on the defined cases. + /// public object Convert(object value, Type targetType, object parameter, string language) { var result = SwitchCases.EvaluateCases(value, TargetType ?? targetType); @@ -73,6 +76,9 @@ public object Convert(object value, Type targetType, object parameter, string la return result?.Content!; } + /// + /// Not implemented. + /// public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); diff --git a/components/Primitives/src/SwitchPresenter/SwitchHelpers.cs b/components/Primitives/src/SwitchPresenter/SwitchHelpers.cs index c3698931..8974b8b6 100644 --- a/components/Primitives/src/SwitchPresenter/SwitchHelpers.cs +++ b/components/Primitives/src/SwitchPresenter/SwitchHelpers.cs @@ -61,6 +61,7 @@ internal static partial class SwitchHelpers /// /// Our main value in our SwitchPresenter. /// The value from the case to compare to. + /// The desired type of the result for automatic conversion. /// true if the two values are equal internal static bool CompareValues(object compare, object value, Type targetType) { diff --git a/components/Segmented/src/EqualPanel.cs b/components/Segmented/src/EqualPanel.cs index 415f05df..3caa7cbf 100644 --- a/components/Segmented/src/EqualPanel.cs +++ b/components/Segmented/src/EqualPanel.cs @@ -6,11 +6,18 @@ namespace CommunityToolkit.WinUI.Controls; +/// +/// A panel that arranges its children in equal columns. +/// public partial class EqualPanel : Panel { private double _maxItemWidth = 0; private double _maxItemHeight = 0; private int _visibleItemsCount = 0; + + /// + /// Gets or sets the spacing between items. + /// public double Spacing { get { return (double)GetValue(SpacingProperty); } @@ -27,11 +34,15 @@ public double Spacing typeof(EqualPanel), new PropertyMetadata(default(double), OnSpacingChanged)); + /// + /// Creates a new instance of the class. + /// public EqualPanel() { RegisterPropertyChangedCallback(HorizontalAlignmentProperty, OnHorizontalAlignmentChanged); } + /// protected override Size MeasureOverride(Size availableSize) { _maxItemWidth = 0; @@ -69,6 +80,7 @@ protected override Size MeasureOverride(Size availableSize) } } + /// protected override Size ArrangeOverride(Size finalSize) { double x = 0; diff --git a/components/Segmented/src/Helpers/SegmentedMarginConverter.cs b/components/Segmented/src/Helpers/SegmentedMarginConverter.cs index 9de95ded..1af08675 100644 --- a/components/Segmented/src/Helpers/SegmentedMarginConverter.cs +++ b/components/Segmented/src/Helpers/SegmentedMarginConverter.cs @@ -4,6 +4,9 @@ namespace CommunityToolkit.WinUI.Controls; +/// +/// A converter that returns a margin based on the position of the item in a segmented control. +/// public partial class SegmentedMarginConverter : DependencyObject, IValueConverter { /// @@ -51,6 +54,7 @@ public Thickness RightItemMargin set { SetValue(RightItemMarginProperty, value); } } + /// public object Convert(object value, Type targetType, object parameter, string language) { var segmentedItem = value as SegmentedItem; @@ -72,6 +76,7 @@ public object Convert(object value, Type targetType, object parameter, string la } } + /// public object ConvertBack(object value, Type targetType, object parameter, string language) { return value; diff --git a/components/Segmented/src/Segmented/Segmented.cs b/components/Segmented/src/Segmented/Segmented.cs index 75e0fb0f..1b75cc1d 100644 --- a/components/Segmented/src/Segmented/Segmented.cs +++ b/components/Segmented/src/Segmented/Segmented.cs @@ -6,11 +6,17 @@ namespace CommunityToolkit.WinUI.Controls; +/// +/// A control that displays a set of items that can be selected by the user. +/// public partial class Segmented : ListViewBase { private int _internalSelectedIndex = -1; private bool _hasLoaded = false; + /// + /// Creates a new instance of . + /// public Segmented() { this.DefaultStyleKey = typeof(Segmented); @@ -18,13 +24,20 @@ public Segmented() RegisterPropertyChangedCallback(SelectedIndexProperty, OnSelectedIndexChanged); } + /// + /// Get the container for the item. + /// protected override DependencyObject GetContainerForItemOverride() => new SegmentedItem(); + /// + /// Check if the item is its own container. + /// protected override bool IsItemItsOwnContainerOverride(object item) { return item is SegmentedItem; } + /// protected override void OnApplyTemplate() { base.OnApplyTemplate(); @@ -37,6 +50,9 @@ protected override void OnApplyTemplate() PreviewKeyDown += Segmented_PreviewKeyDown; } + /// + /// Prepare the container for the item. + /// protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { base.PrepareContainerForItemOverride(element, item); @@ -63,6 +79,9 @@ private void SegmentedItem_Loaded(object sender, RoutedEventArgs e) } } + /// + /// Handles the ItemsChanged event + /// protected override void OnItemsChanged(object e) { base.OnItemsChanged(e); diff --git a/components/Segmented/src/SegmentedItem/SegmentedItem.cs b/components/Segmented/src/SegmentedItem/SegmentedItem.cs index 94a9769f..6fc91435 100644 --- a/components/Segmented/src/SegmentedItem/SegmentedItem.cs +++ b/components/Segmented/src/SegmentedItem/SegmentedItem.cs @@ -4,6 +4,9 @@ namespace CommunityToolkit.WinUI.Controls; +/// +/// Represents an item in a control. +/// [ContentProperty(Name = nameof(Content))] public partial class SegmentedItem : ListViewItem { @@ -11,11 +14,15 @@ public partial class SegmentedItem : ListViewItem internal const string IconOnlyState = "IconOnly"; internal const string ContentOnlyState = "ContentOnly"; + /// + /// Creates a new instance of . + /// public SegmentedItem() { this.DefaultStyleKey = typeof(SegmentedItem); } + /// protected override void OnApplyTemplate() { base.OnApplyTemplate(); @@ -23,6 +30,9 @@ protected override void OnApplyTemplate() ContentChanged(); } + /// + /// Handles changes to the Content property. + /// protected override void OnContentChanged(object oldContent, object newContent) { base.OnContentChanged(oldContent, newContent); @@ -41,6 +51,9 @@ private void ContentChanged() } } + /// + /// Handles changes to the Icon property. + /// protected virtual void OnIconPropertyChanged(IconElement oldValue, IconElement newValue) { OnIconChanged(); diff --git a/components/SettingsControls/src/Helpers/StyleExtensions.cs b/components/SettingsControls/src/Helpers/StyleExtensions.cs index 2a44d465..b34b9fe9 100644 --- a/components/SettingsControls/src/Helpers/StyleExtensions.cs +++ b/components/SettingsControls/src/Helpers/StyleExtensions.cs @@ -4,7 +4,12 @@ namespace CommunityToolkit.WinUI.Controls; -// Adapted from https://github.com/rudyhuyn/XamlPlus +/// +/// Helper class for setting a ResourceDictionary on a Style. +/// +/// +/// Adapted from https://github.com/rudyhuyn/XamlPlus +/// public static partial class StyleExtensions { // Used to distinct normal ResourceDictionary and the one we add. @@ -12,16 +17,25 @@ private sealed partial class StyleExtensionResourceDictionary : ResourceDictiona { } + /// + /// Get a ResourceDictionary from a Style. + /// public static ResourceDictionary GetResources(Style obj) { return (ResourceDictionary)obj.GetValue(ResourcesProperty); } + /// + /// Set the on a Style to a ResourceDictionary value. + /// public static void SetResources(Style obj, ResourceDictionary value) { obj.SetValue(ResourcesProperty, value); } + /// + /// Attached property to set a Style to a ResourceDictionary value. + /// public static readonly DependencyProperty ResourcesProperty = DependencyProperty.RegisterAttached("Resources", typeof(ResourceDictionary), typeof(StyleExtensions), new PropertyMetadata(null, ResourcesChanged)); diff --git a/components/SettingsControls/src/SettingsCard/SettingsCard.Properties.cs b/components/SettingsControls/src/SettingsCard/SettingsCard.Properties.cs index 6152a04e..559cc775 100644 --- a/components/SettingsControls/src/SettingsCard/SettingsCard.Properties.cs +++ b/components/SettingsControls/src/SettingsCard/SettingsCard.Properties.cs @@ -152,41 +152,62 @@ public bool IsActionIconVisible set => SetValue(IsActionIconVisibleProperty, value); } + /// + /// Called when the IsClickEnabled property changes. + /// protected virtual void OnIsClickEnabledPropertyChanged(bool oldValue, bool newValue) { OnIsClickEnabledChanged(); } + + /// + /// Called when the HeaderIcon property changes. + /// protected virtual void OnHeaderIconPropertyChanged(IconElement oldValue, IconElement newValue) { OnHeaderIconChanged(); } + /// + /// Called when the Header property changes. + /// protected virtual void OnHeaderPropertyChanged(object oldValue, object newValue) { OnHeaderChanged(); } + /// + /// Called when the Description property changes. + /// protected virtual void OnDescriptionPropertyChanged(object oldValue, object newValue) { OnDescriptionChanged(); } + /// + /// Called when the IsActionIconVisible property changes. + /// protected virtual void OnIsActionIconVisiblePropertyChanged(bool oldValue, bool newValue) { OnActionIconChanged(); } } +/// +/// The alignment of Content. +/// public enum ContentAlignment { /// /// The Content is aligned to the right. Default state. /// Right, + /// /// The Content is left-aligned while the Header, HeaderIcon and Description are collapsed. This is commonly used for Content types such as CheckBoxes, RadioButtons and custom layouts. /// Left, + /// /// The Content is vertically aligned. /// diff --git a/components/SettingsControls/src/SettingsCard/SettingsCard.cs b/components/SettingsControls/src/SettingsCard/SettingsCard.cs index 6e1e064b..dbc4f12e 100644 --- a/components/SettingsControls/src/SettingsCard/SettingsCard.cs +++ b/components/SettingsControls/src/SettingsCard/SettingsCard.cs @@ -148,12 +148,18 @@ private void Control_PreviewKeyDown(object sender, KeyRoutedEventArgs e) } } + /// + /// Handles the PointerEntered event. + /// public void Control_PointerEntered(object sender, PointerRoutedEventArgs e) { base.OnPointerEntered(e); VisualStateManager.GoToState(this, PointerOverState, true); } + /// + /// Handles the PointerExited event. + /// public void Control_PointerExited(object sender, PointerRoutedEventArgs e) { base.OnPointerExited(e); @@ -172,6 +178,9 @@ private void Control_PointerCanceled(object sender, PointerRoutedEventArgs e) VisualStateManager.GoToState(this, NormalState, true); } + /// + /// Handles the PointerPressed event. + /// protected override void OnPointerPressed(PointerRoutedEventArgs e) { // e.Handled = true; @@ -182,6 +191,9 @@ protected override void OnPointerPressed(PointerRoutedEventArgs e) } } + /// + /// Handles the PointerReleased event. + /// protected override void OnPointerReleased(PointerRoutedEventArgs e) { if (IsClickEnabled) diff --git a/components/SettingsControls/src/SettingsCard/SettingsCardAutomationPeer.cs b/components/SettingsControls/src/SettingsCard/SettingsCardAutomationPeer.cs index 6d287812..7711035b 100644 --- a/components/SettingsControls/src/SettingsCard/SettingsCardAutomationPeer.cs +++ b/components/SettingsControls/src/SettingsCard/SettingsCardAutomationPeer.cs @@ -44,6 +44,7 @@ protected override string GetClassNameCore() return Owner.GetType().Name; } + /// protected override string GetNameCore() { // We only want to announce the button card name if it is clickable, else it's just a regular card that does not receive focus diff --git a/components/SettingsControls/src/SettingsExpander/SettingsExpander.ItemsControl.cs b/components/SettingsControls/src/SettingsExpander/SettingsExpander.ItemsControl.cs index e9de7832..665dd7dd 100644 --- a/components/SettingsControls/src/SettingsExpander/SettingsExpander.ItemsControl.cs +++ b/components/SettingsControls/src/SettingsExpander/SettingsExpander.ItemsControl.cs @@ -2,44 +2,70 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.UI.Xaml.Controls; + namespace CommunityToolkit.WinUI.Controls; //// Implement properties for ItemsControl like behavior. public partial class SettingsExpander { + /// + /// Gets or sets the collection of items to display. + /// public IList Items { get { return (IList)GetValue(ItemsProperty); } set { SetValue(ItemsProperty, value); } } + /// + /// Identifies the DependencyProperty. + /// public static readonly DependencyProperty ItemsProperty = DependencyProperty.Register(nameof(Items), typeof(IList), typeof(SettingsExpander), new PropertyMetadata(null, OnItemsConnectedPropertyChanged)); + /// + /// Gets or sets the value to use for the inner . + /// public object ItemsSource { get { return (object)GetValue(ItemsSourceProperty); } set { SetValue(ItemsSourceProperty, value); } } + /// + /// Identifies the DependencyProperty. + /// public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register(nameof(ItemsSource), typeof(object), typeof(SettingsExpander), new PropertyMetadata(null, OnItemsConnectedPropertyChanged)); + /// + /// Gets or sets the value to use for the inner . + /// public object ItemTemplate { get { return (object)GetValue(ItemTemplateProperty); } set { SetValue(ItemTemplateProperty, value); } } + /// + /// Identifies the DependencyProperty. + /// public static readonly DependencyProperty ItemTemplateProperty = DependencyProperty.Register(nameof(ItemTemplate), typeof(object), typeof(SettingsExpander), new PropertyMetadata(null)); + /// + /// Gets or sets the value to use for the ItemContainerStyle applied to the inner . + /// public StyleSelector ItemContainerStyleSelector { get { return (StyleSelector)GetValue(ItemContainerStyleSelectorProperty); } set { SetValue(ItemContainerStyleSelectorProperty, value); } } + /// + /// Identifies the DependencyProperty. + /// public static readonly DependencyProperty ItemContainerStyleSelectorProperty = DependencyProperty.Register(nameof(ItemContainerStyleSelector), typeof(StyleSelector), typeof(SettingsExpander), new PropertyMetadata(null)); diff --git a/components/SettingsControls/src/SettingsExpander/SettingsExpander.Properties.cs b/components/SettingsControls/src/SettingsExpander/SettingsExpander.Properties.cs index d3924795..53bd92dd 100644 --- a/components/SettingsControls/src/SettingsExpander/SettingsExpander.Properties.cs +++ b/components/SettingsControls/src/SettingsExpander/SettingsExpander.Properties.cs @@ -137,6 +137,8 @@ public bool IsExpanded get => (bool)GetValue(IsExpandedProperty); set => SetValue(IsExpandedProperty, value); } + + /// protected virtual void OnIsExpandedPropertyChanged(bool oldValue, bool newValue) { OnIsExpandedChanged(oldValue, newValue); diff --git a/components/SettingsControls/src/SettingsExpander/SettingsExpander.cs b/components/SettingsControls/src/SettingsExpander/SettingsExpander.cs index d969a16d..b617833c 100644 --- a/components/SettingsControls/src/SettingsExpander/SettingsExpander.cs +++ b/components/SettingsControls/src/SettingsExpander/SettingsExpander.cs @@ -4,6 +4,9 @@ namespace CommunityToolkit.WinUI.Controls; +/// +/// The SettingsExpander is a collapsable control to host multiple SettingsCards. +/// //// Note: ItemsRepeater will request all the available horizontal space: https://github.com/microsoft/microsoft-ui-xaml/issues/3842 [TemplatePart(Name = PART_ItemsRepeater, Type = typeof(MUXC.ItemsRepeater))] public partial class SettingsExpander : Control diff --git a/components/SettingsControls/src/SettingsExpander/SettingsExpanderAutomationPeer.cs b/components/SettingsControls/src/SettingsExpander/SettingsExpanderAutomationPeer.cs index 0fef3e63..d9fe6ecf 100644 --- a/components/SettingsControls/src/SettingsExpander/SettingsExpanderAutomationPeer.cs +++ b/components/SettingsControls/src/SettingsExpander/SettingsExpanderAutomationPeer.cs @@ -42,6 +42,7 @@ protected override string GetClassNameCore() return Owner.GetType().Name; } + /// protected override string GetNameCore() { string name = base.GetNameCore(); diff --git a/components/TokenizingTextBox/src/TokenizingTextBox.cs b/components/TokenizingTextBox/src/TokenizingTextBox.cs index d3972b4e..db1dd012 100644 --- a/components/TokenizingTextBox/src/TokenizingTextBox.cs +++ b/components/TokenizingTextBox/src/TokenizingTextBox.cs @@ -623,5 +623,8 @@ private void GuardAgainstPlaceholderTextLayoutIssue() } } + /// + /// Checks if the XamlRoot property is available via the current API. + /// public static bool IsXamlRootAvailable { get; } = ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot"); } diff --git a/components/Triggers/src/IsNullOrEmptyStateTrigger.cs b/components/Triggers/src/IsNullOrEmptyStateTrigger.cs index 7d792451..6fe934c5 100644 --- a/components/Triggers/src/IsNullOrEmptyStateTrigger.cs +++ b/components/Triggers/src/IsNullOrEmptyStateTrigger.cs @@ -28,6 +28,9 @@ public object Value public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(nameof(Value), typeof(object), typeof(IsNullOrEmptyStateTrigger), new PropertyMetadata(null, OnValuePropertyChanged)); + /// + /// Creates a new instance of . + /// public IsNullOrEmptyStateTrigger() { UpdateTrigger(); From 98bdafeb187a280b0bfb096e75bb624e19dcb1a7 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 13:34:48 -0600 Subject: [PATCH 03/11] Update tooling pointer --- tooling | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling b/tooling index 81a7ceed..be721785 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit 81a7ceed33be91b35dbf541b166de7e2d382494c +Subproject commit be721785480efc04b80c9c57cfe9446b849ae4ac From 869a9c11d089025a7fabf6472e92f281ceb27140 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 13:41:10 -0600 Subject: [PATCH 04/11] Update test runner invocation to target .NET 8.0 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5b6a945..8c646d8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,7 +154,7 @@ jobs: - name: Run SourceGenerators tests id: test-generator - run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx" + run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net8.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx" - name: Run component tests against ${{ matrix.multitarget }} if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }} From 5b8b2b3c8ac5a7633ee4e59fa3e6d47e8b9efeba Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 13:56:49 -0600 Subject: [PATCH 05/11] Refactor XML documentation to use for inherited members --- .../Primitives/src/SwitchPresenter/SwitchConverter.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/Primitives/src/SwitchPresenter/SwitchConverter.cs b/components/Primitives/src/SwitchPresenter/SwitchConverter.cs index e64009b2..470ca28b 100644 --- a/components/Primitives/src/SwitchPresenter/SwitchConverter.cs +++ b/components/Primitives/src/SwitchPresenter/SwitchConverter.cs @@ -66,9 +66,7 @@ public SwitchConverter() SwitchCases = new CaseCollection(); } - /// - /// Converts the provided value based on the defined cases. - /// + /// public object Convert(object value, Type targetType, object parameter, string language) { var result = SwitchCases.EvaluateCases(value, TargetType ?? targetType); @@ -76,9 +74,7 @@ public object Convert(object value, Type targetType, object parameter, string la return result?.Content!; } - /// - /// Not implemented. - /// + /// public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); From 6648706b2283bc0285c0c811ade2b7ac855abb10 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 13:59:42 -0600 Subject: [PATCH 06/11] Refactor XML documentation to use for overridden members --- components/Segmented/src/Segmented/Segmented.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/components/Segmented/src/Segmented/Segmented.cs b/components/Segmented/src/Segmented/Segmented.cs index 1b75cc1d..8441866a 100644 --- a/components/Segmented/src/Segmented/Segmented.cs +++ b/components/Segmented/src/Segmented/Segmented.cs @@ -24,14 +24,10 @@ public Segmented() RegisterPropertyChangedCallback(SelectedIndexProperty, OnSelectedIndexChanged); } - /// - /// Get the container for the item. - /// + /// protected override DependencyObject GetContainerForItemOverride() => new SegmentedItem(); - /// - /// Check if the item is its own container. - /// + /// protected override bool IsItemItsOwnContainerOverride(object item) { return item is SegmentedItem; @@ -50,9 +46,7 @@ protected override void OnApplyTemplate() PreviewKeyDown += Segmented_PreviewKeyDown; } - /// - /// Prepare the container for the item. - /// + /// protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { base.PrepareContainerForItemOverride(element, item); @@ -79,9 +73,7 @@ private void SegmentedItem_Loaded(object sender, RoutedEventArgs e) } } - /// - /// Handles the ItemsChanged event - /// + /// protected override void OnItemsChanged(object e) { base.OnItemsChanged(e); From 4dd8013a8985a304954706ba2513885e124c65ed Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 16:29:40 -0600 Subject: [PATCH 07/11] Workaround for unexpected CS0419 after enabling GenerateDocumentationFile --- Directory.Build.props | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7eb72bb7..bff1bdb4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,8 +29,11 @@ $(NoWarn);TKSMPL0014; - NU1901;NU1902;NU1903;NU1904 + $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 $(NoWarn);TKSMPL0014; + + + $(WarningsNotAsErrors);CS0419 From 0a7618cf2986d6f2bd657d1a5c0d365a10420aff Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 17:01:13 -0600 Subject: [PATCH 08/11] Workaround for unexpected CS1570 after enabling GenerateDocumentationFile --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index bff1bdb4..72def709 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,7 +33,7 @@ $(NoWarn);TKSMPL0014; - $(WarningsNotAsErrors);CS0419 + $(WarningsNotAsErrors);CS0419;CS1570 From 0d3c7fe618b0c35c1682689e56897447ac492d2f Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 17:22:36 -0600 Subject: [PATCH 09/11] Workaround for unexpected CS1574 after enabling GenerateDocumentationFile --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 72def709..4cedcd65 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,7 +33,7 @@ $(NoWarn);TKSMPL0014; - $(WarningsNotAsErrors);CS0419;CS1570 + $(WarningsNotAsErrors);CS0419;CS1570;CS1574 From dab0df090e69ee28c9bc4039d1b787b8fc8997c4 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 18:18:31 -0600 Subject: [PATCH 10/11] Use where needed --- components/ImageCropper/src/ImageCropperThumb.cs | 11 +++++++++-- .../Media/src/Helpers/SurfaceLoader.Instance.cs | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/ImageCropper/src/ImageCropperThumb.cs b/components/ImageCropper/src/ImageCropperThumb.cs index 8036dc8f..3cd46e7f 100644 --- a/components/ImageCropper/src/ImageCropperThumb.cs +++ b/components/ImageCropper/src/ImageCropperThumb.cs @@ -46,6 +46,7 @@ public ImageCropperThumb() } + /// protected override void OnApplyTemplate() { PointerEntered -= Control_PointerEntered; @@ -79,8 +80,6 @@ private static void OnXChanged(DependencyObject d, DependencyPropertyChangedEven target.UpdatePosition(); } - - private static void OnYChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var target = (ImageCropperThumb)d; @@ -99,12 +98,18 @@ private static void OnYChanged(DependencyObject d, DependencyPropertyChangedEven public static readonly DependencyProperty YProperty = DependencyProperty.Register(nameof(Y), typeof(double), typeof(ImageCropperThumb), new PropertyMetadata(0d, OnYChanged)); + /// + /// Handles the PointerEntered event. + /// public void Control_PointerEntered(object sender, PointerRoutedEventArgs e) { base.OnPointerEntered(e); VisualStateManager.GoToState(this, PointerOverState, true); } + /// + /// Handles the PointerExited event. + /// public void Control_PointerExited(object sender, PointerRoutedEventArgs e) { base.OnPointerExited(e); @@ -123,12 +128,14 @@ private void Control_PointerCanceled(object sender, PointerRoutedEventArgs e) VisualStateManager.GoToState(this, NormalState, true); } + /// protected override void OnPointerPressed(PointerRoutedEventArgs e) { base.OnPointerPressed(e); VisualStateManager.GoToState(this, PressedState, true); } + /// protected override void OnPointerReleased(PointerRoutedEventArgs e) { base.OnPointerReleased(e); diff --git a/components/Media/src/Helpers/SurfaceLoader.Instance.cs b/components/Media/src/Helpers/SurfaceLoader.Instance.cs index 97245ece..d480c46c 100644 --- a/components/Media/src/Helpers/SurfaceLoader.Instance.cs +++ b/components/Media/src/Helpers/SurfaceLoader.Instance.cs @@ -226,6 +226,7 @@ public async Task LoadFromUri(Uri uri, Size sizeTarge return await LoadFromUri(uri, sizeTarget); } + /// public void Dispose() { compositionDevice?.Dispose(); From 71cf5767f9fd8c75bc780a793515123b7fddee40 Mon Sep 17 00:00:00 2001 From: Arlo Date: Fri, 24 Jan 2025 19:53:25 -0600 Subject: [PATCH 11/11] Update tooling pointer to latest main --- tooling | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling b/tooling index be721785..1ac9b809 160000 --- a/tooling +++ b/tooling @@ -1 +1 @@ -Subproject commit be721785480efc04b80c9c57cfe9446b849ae4ac +Subproject commit 1ac9b8094bc263c29f7a883b564371eecb8ff152