forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support for SelectorBar and SelectorBarItem
- Loading branch information
1 parent
9930fb3
commit 9068f91
Showing
17 changed files
with
646 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Uno.UI/Microsoft/UI/Xaml/Controls/SelectorBar/SelectorBar.Properties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
// MUX Reference controls\dev\Generated\SelectorBar.properties.cpp, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation; | ||
|
||
namespace Microsoft.UI.Xaml.Controls; | ||
|
||
partial class SelectorBar | ||
{ | ||
/// <summary> | ||
/// Gets the collection of SelectorBarItem instances used to generate the content of the SelectorBar control. | ||
/// </summary> | ||
public IList<SelectorBarItem> Items => (IList<SelectorBarItem>)GetValue(ItemsProperty); | ||
|
||
/// <summary> | ||
/// Identifies the Items dependency property. | ||
/// </summary> | ||
public static DependencyProperty ItemsProperty { get; } = | ||
DependencyProperty.Register( | ||
nameof(Items), | ||
typeof(IList<SelectorBarItem>), | ||
typeof(SelectorBar), | ||
new FrameworkPropertyMetadata(default(IList<SelectorBarItem>), OnPropertyChanged)); | ||
|
||
/// <summary> | ||
/// Gets or sets the currently selected item. | ||
/// </summary> | ||
public SelectorBarItem SelectedItem | ||
{ | ||
get => (SelectorBarItem)GetValue(SelectedItemProperty); | ||
set => SetValue(SelectedItemProperty, value); | ||
} | ||
|
||
/// <summary> | ||
/// Identifies the SelectedItem dependency property. | ||
/// </summary> | ||
public static DependencyProperty SelectedItemProperty { get; } = | ||
DependencyProperty.Register( | ||
nameof(SelectedItem), | ||
typeof(SelectorBarItem), | ||
typeof(SelectorBar), | ||
new FrameworkPropertyMetadata(default(SelectorBarItem), OnPropertyChanged)); | ||
|
||
/// <summary> | ||
/// Occurs when the SelectorBar selection changes; that is, when the SelectedItem property has changed. | ||
/// </summary> | ||
public event TypedEventHandler<SelectorBar, SelectorBarSelectionChangedEventArgs> SelectionChanged; | ||
|
||
private static void OnPropertyChanged( | ||
DependencyObject sender, | ||
DependencyPropertyChangedEventArgs args) | ||
{ | ||
var owner = (SelectorBar)sender; | ||
owner.OnPropertyChanged(args); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Uno.UI/Microsoft/UI/Xaml/Controls/SelectorBar/SelectorBar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#nullable enable | ||
|
||
using Microsoft.UI.Xaml.Markup; | ||
|
||
namespace Microsoft.UI.Xaml.Controls; | ||
|
||
[ContentProperty(Name = nameof(Items))] | ||
public partial class SelectorBar : Control | ||
{ | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Uno.UI/Microsoft/UI/Xaml/Controls/SelectorBar/SelectorBar.h.mux.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
// MUX Reference controls\dev\SelectorBar\SelectorBar.h, tag winui3/release/1.5.2, commit b91b3ce6f25c587a9e18c4e122f348f51331f18b | ||
|
||
#nullable enable | ||
|
||
using Uno.Disposables; | ||
|
||
namespace Microsoft.UI.Xaml.Controls; | ||
|
||
partial class SelectorBar | ||
{ | ||
private ItemsView? _itemsView; | ||
|
||
private readonly SerialDisposable _loadedRevoker = new(); | ||
|
||
private readonly SerialDisposable _itemsViewSelectedItemPropertyChangedRevoker = new(); | ||
|
||
private const string s_itemsViewPartName = "PART_ItemsView"; | ||
} |
Oops, something went wrong.