Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/Core/src/Platform/Windows/MauiPasswordTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.UI.Xaml.Input;
using Windows.System;
using Windows.UI.Core;
using Microsoft.UI.Xaml.Automation.Peers;

namespace Microsoft.Maui.Platform
{
Expand Down Expand Up @@ -151,6 +152,11 @@ protected override void OnKeyDown(KeyRoutedEventArgs e)
base.OnKeyDown(e);
}

protected override AutomationPeer OnCreateAutomationPeer()
{
return new MauiPasswordTextBoxAutomationPeer(this);
}

private void OnNativeTextChanging(TextBox sender, TextBoxTextChangingEventArgs args)
{
// We are handling the CursorPosition issue at Platform.TextBoxExtensions.UpdateText method
Expand Down Expand Up @@ -348,4 +354,17 @@ static InputScope CreateInputScope(InputScopeNameValue value) =>
}
};
}

//TODO: Make it public in NET 11
internal partial class MauiPasswordTextBoxAutomationPeer : TextBoxAutomationPeer
{
public MauiPasswordTextBoxAutomationPeer(MauiPasswordTextBox owner) : base(owner)
{
}

protected override bool IsPasswordCore()
{
return ((MauiPasswordTextBox)Owner).IsPassword;
}
}
}
1 change: 1 addition & 0 deletions src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#nullable enable
override Microsoft.Maui.Platform.MauiPasswordTextBox.OnCreateAutomationPeer() -> Microsoft.UI.Xaml.Automation.Peers.AutomationPeer!
override Microsoft.Maui.Handlers.GraphicsViewHandler.NeedsContainer.get -> bool
Loading