diff --git a/components/CanvasLayout/samples/CanvasLayout.md b/components/CanvasLayout/samples/CanvasLayout.md index 48ee61839..fa152bc24 100644 --- a/components/CanvasLayout/samples/CanvasLayout.md +++ b/components/CanvasLayout/samples/CanvasLayout.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Controls subcategory: Layout +experimental: true discussion-id: 311 issue-id: 213 icon: Assets/CanvasLayout.png diff --git a/components/CanvasView/samples/CanvasView.md b/components/CanvasView/samples/CanvasView.md index 17b96651e..4ba16b884 100644 --- a/components/CanvasView/samples/CanvasView.md +++ b/components/CanvasView/samples/CanvasView.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Controls subcategory: Layout +experimental: true discussion-id: 310 issue-id: 212 icon: Assets/CanvasView.png diff --git a/components/DataTable/samples/DataTable.md b/components/DataTable/samples/DataTable.md index 6e85b7cd2..c9cdf1a98 100644 --- a/components/DataTable/samples/DataTable.md +++ b/components/DataTable/samples/DataTable.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Controls subcategory: Layout +experimental: true discussion-id: 415 issue-id: 0 icon: Assets/DataTable.png diff --git a/components/MarqueeText/samples/MarqueeText.md b/components/MarqueeText/samples/MarqueeText.md index b9edca4d3..786ee98f9 100644 --- a/components/MarqueeText/samples/MarqueeText.md +++ b/components/MarqueeText/samples/MarqueeText.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Controls subcategory: StatusAndInfo +experimental: true discussion-id: 231 issue-id: 0 icon: Assets/MarqueeText.png diff --git a/components/RivePlayer/samples/RivePlayer.md b/components/RivePlayer/samples/RivePlayer.md index b583f15a9..ca11c3bf4 100644 --- a/components/RivePlayer/samples/RivePlayer.md +++ b/components/RivePlayer/samples/RivePlayer.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Animations subcategory: Media +experimental: true discussion-id: 309 issue-id: 0 icon: Assets/RivePlayer.png diff --git a/components/SegmentedControl/OpenSolution.bat b/components/SegmentedControl/OpenSolution.bat deleted file mode 100644 index 814a56d4b..000000000 --- a/components/SegmentedControl/OpenSolution.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF - -powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* \ No newline at end of file diff --git a/components/SegmentedControl/samples/Assets/Segmented.png b/components/SegmentedControl/samples/Assets/Segmented.png deleted file mode 100644 index ba9ad789d..000000000 Binary files a/components/SegmentedControl/samples/Assets/Segmented.png and /dev/null differ diff --git a/components/SegmentedControl/samples/Dependencies.props b/components/SegmentedControl/samples/Dependencies.props deleted file mode 100644 index e622e1df4..000000000 --- a/components/SegmentedControl/samples/Dependencies.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/SegmentedControl/samples/SegmentedControl.Samples.csproj b/components/SegmentedControl/samples/SegmentedControl.Samples.csproj deleted file mode 100644 index ce157cc0c..000000000 --- a/components/SegmentedControl/samples/SegmentedControl.Samples.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - SegmentedControl - - - - - diff --git a/components/SegmentedControl/samples/SegmentedControl.md b/components/SegmentedControl/samples/SegmentedControl.md deleted file mode 100644 index c381cd75b..000000000 --- a/components/SegmentedControl/samples/SegmentedControl.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: SegmentedControl -author: niels9001 -description: A common UI control to configure a view or setting. -keywords: SegmentedControl, Control, Layout -dev_langs: - - csharp -category: Controls -subcategory: Input -discussion-id: 314 -issue-id: 392 -icon: Assets/Segmented.png ---- - -## The basics - -The `Segmented` control is best used with 2-5 items and does not support overflow. The `Icon` and `Content` property can be set on the `SegmentedItems`. - -> [!Sample SegmentedControlBasicSample] - -## Selection -`Segmented` supports single and multi-selection. When `SelectionMode` is set to `Single` the first item will be selected by default. This can be overriden by settings `AutoSelection` to `false`. - -## Other styles - -The `Segmented` control contains various additional styles, to match the look and feel of your application. The `PivotSegmentedStyle` matches a modern `Pivot` style while the `ButtonSegmentedStyle` represents buttons. - -> [!SAMPLE SegmentedControlStylesSample] diff --git a/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml b/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml deleted file mode 100644 index a12b007f7..000000000 --- a/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml.cs b/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml.cs deleted file mode 100644 index 9a8904f7d..000000000 --- a/components/SegmentedControl/samples/SegmentedControlBasicSample.xaml.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// 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; -using CommunityToolkit.Labs.WinUI; - -namespace SegmentedControlExperiment.Samples; - -/// -/// An example sample page of a Segmented control. -/// -[ToolkitSampleMultiChoiceOption("SelectionMode", "Single", "Multiple", Title = "Selection mode")] -[ToolkitSampleMultiChoiceOption("Alignment", "Left", "Center", "Right", "Stretch", Title = "Horizontal alignment")] - -[ToolkitSample(id: nameof(SegmentedControlBasicSample), "Basics", description: $"A sample for showing how to create and use a {nameof(Segmented)} custom control.")] -public sealed partial class SegmentedControlBasicSample : Page -{ - public SegmentedControlBasicSample() - { - this.InitializeComponent(); - } - - // TODO: See https://github.com/CommunityToolkit/Labs-Windows/issues/149 - public static ListViewSelectionMode ConvertStringToSelectionMode(string selectionMode) => selectionMode switch - { - "Single" => ListViewSelectionMode.Single, - "Multiple" => ListViewSelectionMode.Multiple, - _ => throw new System.NotImplementedException(), - }; - - public static HorizontalAlignment ConvertStringToHorizontalAlignment(string alignment) => alignment switch - { - "Left" => HorizontalAlignment.Left, - "Center" => HorizontalAlignment.Center, - "Right" => HorizontalAlignment.Right, - "Stretch" => HorizontalAlignment.Stretch, - _ => throw new System.NotImplementedException(), - }; -} - diff --git a/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml b/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml deleted file mode 100644 index 320efeb66..000000000 --- a/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - Item 1 - Item 2 - Item with long label - Item 4 - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml.cs b/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml.cs deleted file mode 100644 index 46c9f542c..000000000 --- a/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace SegmentedControlExperiment.Samples; - -/// -/// An sample that shows how the Segmented control has multiple built-in styles. -/// -[ToolkitSampleMultiChoiceOption("SelectionMode", "Single", "Multiple", Title = "Selection mode")] - -[ToolkitSample(id: nameof(SegmentedControlStylesSample), "Additional styles", description: "A sample on how to use different built-in styles.")] -public sealed partial class SegmentedControlStylesSample : Page -{ - public SegmentedControlStylesSample() - { - this.InitializeComponent(); - } - public static ListViewSelectionMode ConvertStringToSelectionMode(string selectionMode) => selectionMode switch - { - "Single" => ListViewSelectionMode.Single, - "Multiple" => ListViewSelectionMode.Multiple, - _ => throw new System.NotImplementedException(), - }; -} diff --git a/components/SegmentedControl/src/CommunityToolkit.Labs.WinUI.SegmentedControl.csproj b/components/SegmentedControl/src/CommunityToolkit.Labs.WinUI.SegmentedControl.csproj deleted file mode 100644 index 8c27da340..000000000 --- a/components/SegmentedControl/src/CommunityToolkit.Labs.WinUI.SegmentedControl.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - SegmentedControl - This package contains SegmentedControl. - - - CommunityToolkit.Labs.WinUI.SegmentedControlRns - - - - - diff --git a/components/SegmentedControl/src/Dependencies.props b/components/SegmentedControl/src/Dependencies.props deleted file mode 100644 index 82dae261e..000000000 --- a/components/SegmentedControl/src/Dependencies.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/SegmentedControl/src/EqualPanel.cs b/components/SegmentedControl/src/EqualPanel.cs deleted file mode 100644 index 57089992f..000000000 --- a/components/SegmentedControl/src/EqualPanel.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Data; - -namespace CommunityToolkit.Labs.WinUI; - -public partial class EqualPanel : Panel -{ - private double _maxItemWidth = 0; - private double _maxItemHeight = 0; - private int _visibleItemsCount = 0; - public double Spacing - { - get { return (double)GetValue(SpacingProperty); } - set { SetValue(SpacingProperty, value); } - } - - /// - /// Identifies the Spacing dependency property. - /// - /// The identifier for the dependency property. - public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register( - nameof(Spacing), - typeof(double), - typeof(EqualPanel), - new PropertyMetadata(default(double), OnSpacingChanged)); - - public EqualPanel() - { - RegisterPropertyChangedCallback(HorizontalAlignmentProperty, OnHorizontalAlignmentChanged); - } - - protected override Size MeasureOverride(Size availableSize) - { - _maxItemWidth = 0; - _maxItemHeight = 0; - - var elements = Children.Where(static e => e.Visibility == Visibility.Visible); - _visibleItemsCount = elements.Count(); - - foreach (var child in elements) - { - child.Measure(availableSize); - _maxItemWidth = Math.Max(_maxItemWidth, child.DesiredSize.Width); - _maxItemHeight = Math.Max(_maxItemHeight, child.DesiredSize.Height); - } - - if (_visibleItemsCount > 0) - { - // Return equal widths based on the widest item - // In very specific edge cases the AvailableWidth might be infinite resulting in a crash. - if (HorizontalAlignment != HorizontalAlignment.Stretch || double.IsInfinity(availableSize.Width)) - { - return new Size((_maxItemWidth * _visibleItemsCount) + (Spacing * (_visibleItemsCount - 1)), _maxItemHeight); - } - else - { - // Equal columns based on the available width, adjust for spacing - double totalWidth = availableSize.Width - (Spacing * (_visibleItemsCount - 1)); - _maxItemWidth = totalWidth / _visibleItemsCount; - return new Size(availableSize.Width, _maxItemHeight); - } - } - else - { - return new Size(0, 0); - } - } - - protected override Size ArrangeOverride(Size finalSize) - { - double x = 0; - - // Check if there's more width available - if so, recalculate (e.g. whenever Grid.Column is set to Auto) - if (finalSize.Width > _visibleItemsCount * _maxItemWidth + (Spacing * (_visibleItemsCount - 1))) - { - MeasureOverride(finalSize); - } - - var elements = Children.Where(static e => e.Visibility == Visibility.Visible); - foreach (var child in elements) - { - child.Arrange(new Rect(x, 0, _maxItemWidth, _maxItemHeight)); - x += _maxItemWidth + Spacing; - } - return finalSize; - } - - private void OnHorizontalAlignmentChanged(DependencyObject sender, DependencyProperty dp) - { - InvalidateMeasure(); - } - - private static void OnSpacingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var panel = (EqualPanel)d; - panel.InvalidateMeasure(); - } -} diff --git a/components/SegmentedControl/src/Helpers/ControlHelpers.cs b/components/SegmentedControl/src/Helpers/ControlHelpers.cs deleted file mode 100644 index 4bca4e707..000000000 --- a/components/SegmentedControl/src/Helpers/ControlHelpers.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace CommunityToolkit.Labs.WinUI; -internal static partial class ControlHelpers -{ - internal static bool IsXamlRootAvailable { get; } = Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot"); -} diff --git a/components/SegmentedControl/src/Helpers/SegmentedMarginConverter.cs b/components/SegmentedControl/src/Helpers/SegmentedMarginConverter.cs deleted file mode 100644 index 06e1624b4..000000000 --- a/components/SegmentedControl/src/Helpers/SegmentedMarginConverter.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace CommunityToolkit.Labs.WinUI; -public partial class SegmentedMarginConverter : DependencyObject, IValueConverter -{ - /// - /// Identifies the property. - /// - public static readonly DependencyProperty LeftItemMarginProperty = - DependencyProperty.Register(nameof(LeftItemMargin), typeof(Thickness), typeof(SegmentedMarginConverter), new PropertyMetadata(null)); - - /// - /// Gets or sets the margin of the first item - /// - public Thickness LeftItemMargin - { - get { return (Thickness)GetValue(LeftItemMarginProperty); } - set { SetValue(LeftItemMarginProperty, value); } - } - - /// - /// Identifies the property. - /// - public static readonly DependencyProperty MiddleItemMarginProperty = - DependencyProperty.Register(nameof(MiddleItemMargin), typeof(Thickness), typeof(SegmentedMarginConverter), new PropertyMetadata(null)); - - /// - /// Gets or sets the margin of any middle item - /// - public Thickness MiddleItemMargin - { - get { return (Thickness)GetValue(MiddleItemMarginProperty); } - set { SetValue(MiddleItemMarginProperty, value); } - } - - /// - /// Identifies the property. - /// - public static readonly DependencyProperty RightItemMarginProperty = - DependencyProperty.Register(nameof(RightItemMargin), typeof(Thickness), typeof(SegmentedMarginConverter), new PropertyMetadata(null)); - - /// - /// Gets or sets the margin of the last item - /// - public Thickness RightItemMargin - { - get { return (Thickness)GetValue(RightItemMarginProperty); } - set { SetValue(RightItemMarginProperty, value); } - } - - public object Convert(object value, Type targetType, object parameter, string language) - { - var segmentedItem = value as SegmentedItem; - var listView = ItemsControl.ItemsControlFromItemContainer(segmentedItem); - - int index = listView.IndexFromContainer(segmentedItem); - - if (index == 0) - { - return LeftItemMargin; - } - else if (index == listView.Items.Count - 1) - { - return RightItemMargin; - } - else - { - return MiddleItemMargin; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - return value; - } -} diff --git a/components/SegmentedControl/src/MultiTarget.props b/components/SegmentedControl/src/MultiTarget.props deleted file mode 100644 index b11c19426..000000000 --- a/components/SegmentedControl/src/MultiTarget.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; - - \ No newline at end of file diff --git a/components/SegmentedControl/src/Segmented/Segmented.cs b/components/SegmentedControl/src/Segmented/Segmented.cs deleted file mode 100644 index a8d72f603..000000000 --- a/components/SegmentedControl/src/Segmented/Segmented.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Windows.System; - -namespace CommunityToolkit.Labs.WinUI; - -public partial class Segmented : ListViewBase -{ - private int _internalSelectedIndex = -1; - private bool _hasLoaded = false; - - public Segmented() - { - this.DefaultStyleKey = typeof(Segmented); - - RegisterPropertyChangedCallback(SelectedIndexProperty, OnSelectedIndexChanged); - } - - protected override DependencyObject GetContainerForItemOverride() => new SegmentedItem(); - - protected override bool IsItemItsOwnContainerOverride(object item) - { - return item is SegmentedItem; - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - if (!_hasLoaded) - { - SelectedIndex = _internalSelectedIndex; - _hasLoaded = true; - } - PreviewKeyDown -= Segmented_PreviewKeyDown; - PreviewKeyDown += Segmented_PreviewKeyDown; - } - - protected override void PrepareContainerForItemOverride(DependencyObject element, object item) - { - base.PrepareContainerForItemOverride(element, item); - if (element is SegmentedItem segmentedItem) - { - segmentedItem.Loaded += SegmentedItem_Loaded; - } - } - - private void Segmented_PreviewKeyDown(object sender, KeyRoutedEventArgs e) - { - switch (e.Key) - { - case VirtualKey.Left: e.Handled = MoveFocus(MoveDirection.Previous); break; - case VirtualKey.Right: e.Handled = MoveFocus(MoveDirection.Next); break; - } - } - - private void SegmentedItem_Loaded(object sender, RoutedEventArgs e) - { - if (sender is SegmentedItem segmentedItem) - { - segmentedItem.Loaded -= SegmentedItem_Loaded; - } - } - - protected override void OnItemsChanged(object e) - { - base.OnItemsChanged(e); - } - - private enum MoveDirection - { - Next, - Previous - } - - /// - /// Adjust the selected item and range based on keyboard input. - /// This is used to override the ListView behaviors for up/down arrow manipulation vs left/right for a horizontal control - /// - /// direction to move the selection - /// True if the focus was moved, false otherwise - private bool MoveFocus(MoveDirection direction) - { - bool retVal = false; - var currentContainerItem = GetCurrentContainerItem(); - - if (currentContainerItem != null) - { - var currentItem = ItemFromContainer(currentContainerItem); - var previousIndex = Items.IndexOf(currentItem); - var index = previousIndex; - - if (direction == MoveDirection.Previous) - { - if (previousIndex > 0) - { - index -= 1; - } - else - { - retVal = true; - } - } - else if (direction == MoveDirection.Next) - { - if (previousIndex < Items.Count - 1) - { - index += 1; - } - } - - // Only do stuff if the index is actually changing - if (index != previousIndex && ContainerFromIndex(index) is SegmentedItem newItem) - { - newItem.Focus(FocusState.Keyboard); - retVal = true; - } - } - - return retVal; - } - - private SegmentedItem? GetCurrentContainerItem() - { - if (ControlHelpers.IsXamlRootAvailable && XamlRoot != null) - { - return FocusManager.GetFocusedElement(XamlRoot) as SegmentedItem; - } - else - { - return FocusManager.GetFocusedElement() as SegmentedItem; - } - } - - private void OnSelectedIndexChanged(DependencyObject sender, DependencyProperty dp) - { - // This is a workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/8257 - if (_internalSelectedIndex == -1 && SelectedIndex > -1) - { - // We catch the correct SelectedIndex and save it. - _internalSelectedIndex = SelectedIndex; - } - } -} diff --git a/components/SegmentedControl/src/Segmented/Segmented.xaml b/components/SegmentedControl/src/Segmented/Segmented.xaml deleted file mode 100644 index bb075fe0a..000000000 --- a/components/SegmentedControl/src/Segmented/Segmented.xaml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - 1 - - - - - 1 - - - - - 1 - - - - - 1 - 2 - - - - - - - diff --git a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.Properties.cs b/components/SegmentedControl/src/SegmentedItem/SegmentedItem.Properties.cs deleted file mode 100644 index cb824e682..000000000 --- a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.Properties.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace CommunityToolkit.Labs.WinUI; - -public partial class SegmentedItem : ListViewItem -{ - /// - /// The backing for the property. - /// - public static readonly DependencyProperty IconProperty = DependencyProperty.Register( - nameof(Icon), - typeof(IconElement), - typeof(SegmentedItem), - new PropertyMetadata(defaultValue: null, (d, e) => ((SegmentedItem)d).OnIconPropertyChanged((IconElement)e.OldValue, (IconElement)e.NewValue))); - - /// - /// Gets or sets the icon. - /// - public IconElement Icon - { - get => (IconElement)GetValue(IconProperty); - set => SetValue(IconProperty, value); - } -} diff --git a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.cs b/components/SegmentedControl/src/SegmentedItem/SegmentedItem.cs deleted file mode 100644 index 695be7916..000000000 --- a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace CommunityToolkit.Labs.WinUI; - -[ContentProperty(Name = nameof(Content))] -public partial class SegmentedItem : ListViewItem -{ - internal const string IconLeftState = "IconLeft"; - internal const string IconOnlyState = "IconOnly"; - internal const string ContentOnlyState = "ContentOnly"; - - public SegmentedItem() - { - this.DefaultStyleKey = typeof(SegmentedItem); - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - OnIconChanged(); - ContentChanged(); - } - - protected override void OnContentChanged(object oldContent, object newContent) - { - base.OnContentChanged(oldContent, newContent); - ContentChanged(); - } - - private void ContentChanged() - { - if (Content != null) - { - VisualStateManager.GoToState(this, IconLeftState, true); - } - else - { - VisualStateManager.GoToState(this, IconOnlyState, true); - } - } - - protected virtual void OnIconPropertyChanged(IconElement oldValue, IconElement newValue) - { - OnIconChanged(); - } - - private void OnIconChanged() - { - if (Icon != null) - { - VisualStateManager.GoToState(this, IconLeftState, true); - } - else - { - VisualStateManager.GoToState(this, ContentOnlyState, true); - } - } -} diff --git a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.xaml b/components/SegmentedControl/src/SegmentedItem/SegmentedItem.xaml deleted file mode 100644 index 8963c4960..000000000 --- a/components/SegmentedControl/src/SegmentedItem/SegmentedItem.xaml +++ /dev/null @@ -1,1098 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 0.55 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 0.55 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 0.55 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00:00:00.167 - - - - - - - - diff --git a/components/SegmentedControl/src/Themes/Generic.xaml b/components/SegmentedControl/src/Themes/Generic.xaml deleted file mode 100644 index c60f005ee..000000000 --- a/components/SegmentedControl/src/Themes/Generic.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/components/SegmentedControl/tests/ExampleSegmentedControlTestClass.cs b/components/SegmentedControl/tests/ExampleSegmentedControlTestClass.cs deleted file mode 100644 index c11be1ea8..000000000 --- a/components/SegmentedControl/tests/ExampleSegmentedControlTestClass.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using CommunityToolkit.Labs.WinUI; -using CommunityToolkit.Tooling.TestGen; -using CommunityToolkit.Tests; - -namespace SegmentedControlExperiment.Tests; - -[TestClass] -public partial class ExampleSegmentedControlTestClass : VisualUITestBase -{ - // If you don't need access to UI objects directly or async code, use this pattern. - [TestMethod] - public void SimpleSynchronousExampleTest() - { - var assembly = typeof(Segmented).Assembly; - var type = assembly.GetType(typeof(Segmented).FullName ?? string.Empty); - - Assert.IsNotNull(type, "Could not find SegmentedControl type."); - Assert.AreEqual(typeof(Segmented), type, "Type of SegmentedControl does not match expected type."); - } - - // If you don't need access to UI objects directly, use this pattern. - [TestMethod] - public async Task SimpleAsyncExampleTest() - { - await Task.Delay(250); - - Assert.IsTrue(true); - } - - // Example that shows how to check for exception throwing. - [TestMethod] - public void SimpleExceptionCheckTest() - { - // If you need to check exceptions occur for invalid inputs, etc... - // Use Assert.ThrowsException to limit the scope to where you expect the error to occur. - // Otherwise, using the ExpectedException attribute could swallow or - // catch other issues in setup code. - Assert.ThrowsException(() => throw new NotImplementedException()); - } - - // The UIThreadTestMethod automatically dispatches to the UI for us to work with UI objects. - [UIThreadTestMethod] - public void SimpleUIAttributeExampleTest() - { - var component = new Segmented(); - Assert.IsNotNull(component); - } - - // The UIThreadTestMethod can also easily grab a XAML Page for us by passing its type as a parameter. - // This lets us actually test a control as it would behave within an actual application. - // The page will already be loaded by the time your test is called. - [UIThreadTestMethod] - public void SimpleUIExamplePageTest(ExampleSegmentedControlTestPage page) - { - // You can use the Toolkit Visual Tree helpers here to find the component by type or name: - var component = page.FindDescendant(); - - Assert.IsNotNull(component); - - var componentByName = page.FindDescendant("SegmentedControlControl"); - - Assert.IsNotNull(componentByName); - } - - // You can still do async work with a UIThreadTestMethod as well. - [UIThreadTestMethod] - public async Task SimpleAsyncUIExamplePageTest(ExampleSegmentedControlTestPage page) - { - // This helper can be used to wait for a rendering pass to complete. - await CompositionTargetHelper.ExecuteAfterCompositionRenderingAsync(() => { }); - - var component = page.FindDescendant(); - - Assert.IsNotNull(component); - } - - //// ----------------------------- ADVANCED TEST SCENARIOS ----------------------------- - - // If you need to use DataRow, you can use this pattern with the UI dispatch still. - // Otherwise, checkout the UIThreadTestMethod attribute above. - // See https://github.com/CommunityToolkit/Labs-Windows/issues/186 - [TestMethod] - public async Task ComplexAsyncUIExampleTest() - { - await EnqueueAsync(() => - { - var component = new Segmented(); - Assert.IsNotNull(component); - }); - } - - // If you want to load other content not within a XAML page using the UIThreadTestMethod above. - // Then you can do that using the Load/UnloadTestContentAsync methods. - [TestMethod] - public async Task ComplexAsyncLoadUIExampleTest() - { - await EnqueueAsync(async () => - { - var component = new Segmented(); - Assert.IsNotNull(component); - Assert.IsFalse(component.IsLoaded); - - await LoadTestContentAsync(component); - - Assert.IsTrue(component.IsLoaded); - - await UnloadTestContentAsync(component); - - Assert.IsFalse(component.IsLoaded); - }); - } - - // You can still use the UIThreadTestMethod to remove the extra layer for the dispatcher as well: - [UIThreadTestMethod] - public async Task ComplexAsyncLoadUIExampleWithoutDispatcherTest() - { - var component = new Segmented(); - Assert.IsNotNull(component); - Assert.IsFalse(component.IsLoaded); - - await LoadTestContentAsync(component); - - Assert.IsTrue(component.IsLoaded); - - await UnloadTestContentAsync(component); - - Assert.IsFalse(component.IsLoaded); - } -} diff --git a/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml b/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml deleted file mode 100644 index 5675e7d7a..000000000 --- a/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml.cs b/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml.cs deleted file mode 100644 index c90bd13c8..000000000 --- a/components/SegmentedControl/tests/ExampleSegmentedControlTestPage.xaml.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace SegmentedControlExperiment.Tests; - -/// -/// An empty page that can be used on its own or navigated to within a Frame. -/// -public sealed partial class ExampleSegmentedControlTestPage : Page -{ - public ExampleSegmentedControlTestPage() - { - this.InitializeComponent(); - } -} diff --git a/components/SegmentedControl/tests/SegmentedControl.Tests.projitems b/components/SegmentedControl/tests/SegmentedControl.Tests.projitems deleted file mode 100644 index ad951d002..000000000 --- a/components/SegmentedControl/tests/SegmentedControl.Tests.projitems +++ /dev/null @@ -1,23 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 87C6C160-4C36-4065-B8EC-21EF8E3CE9AD - - - SegmentedControlExperiment.Tests - - - - - ExampleSegmentedControlTestPage.xaml - - - - - Designer - MSBuild:Compile - - - \ No newline at end of file diff --git a/components/SegmentedControl/tests/SegmentedControl.Tests.shproj b/components/SegmentedControl/tests/SegmentedControl.Tests.shproj deleted file mode 100644 index 7a35c0a41..000000000 --- a/components/SegmentedControl/tests/SegmentedControl.Tests.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 87C6C160-4C36-4065-B8EC-21EF8E3CE9AD - 14.0 - - - - - - - - diff --git a/components/Shimmer/samples/Shimmer.md b/components/Shimmer/samples/Shimmer.md index a39492ffa..3a0f67321 100644 --- a/components/Shimmer/samples/Shimmer.md +++ b/components/Shimmer/samples/Shimmer.md @@ -7,6 +7,7 @@ dev_langs: - csharp category: Controls subcategory: Layout +experimental: true discussion-id: 381 issue-id: 390 icon: Assets/Shimmer.png diff --git a/components/StackedNotificationsBehavior/OpenSolution.bat b/components/StackedNotificationsBehavior/OpenSolution.bat deleted file mode 100644 index 814a56d4b..000000000 --- a/components/StackedNotificationsBehavior/OpenSolution.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF - -powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* \ No newline at end of file diff --git a/components/StackedNotificationsBehavior/samples/Assets/StackedNotificationsBehavior.png b/components/StackedNotificationsBehavior/samples/Assets/StackedNotificationsBehavior.png deleted file mode 100644 index c702cf876..000000000 Binary files a/components/StackedNotificationsBehavior/samples/Assets/StackedNotificationsBehavior.png and /dev/null differ diff --git a/components/StackedNotificationsBehavior/samples/Dependencies.props b/components/StackedNotificationsBehavior/samples/Dependencies.props deleted file mode 100644 index e622e1df4..000000000 --- a/components/StackedNotificationsBehavior/samples/Dependencies.props +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.Samples.csproj b/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.Samples.csproj deleted file mode 100644 index 702f72215..000000000 --- a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.Samples.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - StackedNotificationsBehavior - 10.0 - - - - - diff --git a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.md b/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.md deleted file mode 100644 index 0e814be1e..000000000 --- a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehavior.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: StackedNotificationsBehavior -author: vgromfeld -description: A behavior to add stacked notifications to a WinUI InfoBar control. -keywords: StackedNotificationsBehavior, Control, Layout, InfoBar, Behavior -dev_langs: - - csharp -category: Xaml -subcategory: Behaviors -discussion-id: 312 -issue-id: 210 -icon: Assets/StackedNotificationsBehavior.png ---- - -This initial example shows how to attach the behavior to an `InfoBar` and send it a message. - -Clicking on the button multiple times will queue up multiple messages to be displayed one after another. - -> [!Sample StackedNotificationsBehaviorCustomSample] diff --git a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehaviorCustomSample.xaml b/components/StackedNotificationsBehavior/samples/StackedNotificationsBehaviorCustomSample.xaml deleted file mode 100644 index 6bf1c00b7..000000000 --- a/components/StackedNotificationsBehavior/samples/StackedNotificationsBehaviorCustomSample.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - -