Skip to content

Commit

Permalink
feat: Implement SelectorItemAutomationPeer
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev authored and MartinZikmund committed Jun 17, 2024
1 parent 0dcdd4d commit a7a29f6
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#pragma warning disable 114 // new keyword hiding
namespace Microsoft.UI.Xaml.Automation.Peers
{
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented]
#endif
public partial class SelectorItemAutomationPeer : global::Microsoft.UI.Xaml.Automation.Peers.ItemAutomationPeer, global::Microsoft.UI.Xaml.Automation.Provider.ISelectionItemProvider
{
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public bool IsSelected
{
Expand All @@ -18,7 +18,7 @@ public bool IsSelected
}
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::Microsoft.UI.Xaml.Automation.Provider.IRawElementProviderSimple SelectionContainer
{
Expand All @@ -28,7 +28,7 @@ public bool IsSelected
}
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public SelectorItemAutomationPeer(object item, global::Microsoft.UI.Xaml.Automation.Peers.SelectorAutomationPeer parent) : base(item, parent)
{
Expand All @@ -38,21 +38,21 @@ public SelectorItemAutomationPeer(object item, global::Microsoft.UI.Xaml.Automat
// Forced skipping of method Microsoft.UI.Xaml.Automation.Peers.SelectorItemAutomationPeer.SelectorItemAutomationPeer(object, Microsoft.UI.Xaml.Automation.Peers.SelectorAutomationPeer)
// Forced skipping of method Microsoft.UI.Xaml.Automation.Peers.SelectorItemAutomationPeer.IsSelected.get
// Forced skipping of method Microsoft.UI.Xaml.Automation.Peers.SelectorItemAutomationPeer.SelectionContainer.get
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public void AddToSelection()
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Microsoft.UI.Xaml.Automation.Peers.SelectorItemAutomationPeer", "void SelectorItemAutomationPeer.AddToSelection()");
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public void RemoveFromSelection()
{
global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Microsoft.UI.Xaml.Automation.Peers.SelectorItemAutomationPeer", "void SelectorItemAutomationPeer.RemoveFromSelection()");
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public void Select()
{
Expand Down
85 changes: 85 additions & 0 deletions src/Uno.UI/UI/Xaml/Automation/Peers/SelectorItemAutomationPeer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
// MUX Reference SelectorItemAutomationPeer_Partial.cpp, tag winui3/release/1.4.2
namespace Microsoft.UI.Xaml.Automation.Peers;

/// <summary>
/// Exposes the items in a Selector to Microsoft UI Automation.
/// </summary>
public partial class SelectorItemAutomationPeer : ItemAutomationPeer, Provider.ISelectionItemProvider
{
public SelectorItemAutomationPeer(object item, SelectorAutomationPeer parent) : base(item, parent)
{
}

protected override object GetPatternCore(PatternInterface patternInterface)
{
var spPatternProvider = base.GetPatternCore(patternInterface);

if (spPatternProvider is not { })
{
return spPatternProvider;
}

if (patternInterface == PatternInterface.SelectionItem)
{
bool selectionPatternApplicable = true;

if (Parent)
{
(Owner
}
}
}

/// <summary>
/// Clears any existing selection and then selects the current element.
/// </summary>
public void Select()
{

}

/// <summary>
/// Adds the current element to the collection of selected items.
/// </summary>
public void AddToSelection()
{

}

/// <summary>
/// Removes the current element from the collection of selected items.
/// </summary>
public void RemoveFromSelection()
{

}

/// <summary>
/// Gets a value that indicates whether an item is selected.
/// </summary>
public bool IsSelected
{
get
{

}
}

/// <summary>
/// Gets the UI Automation provider that implements ISelectionProvider and acts as container for the calling object.
/// </summary>
public Provider.IRawElementProviderSimple SelectionContainer
{
get
{

}
}

internal void ScrollIntoView()
{

}
}

0 comments on commit a7a29f6

Please sign in to comment.