Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ProtectedCursor is now supported in Uno Platform #433

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 1 addition & 3 deletions components/Sizers/src/SizerBase.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ private static void OnOrientationPropertyChanged(DependencyObject d, DependencyP
return;
#endif

// TODO: [UNO] Only supported on certain platforms
// See ProtectedCursor here: https://github.com/unoplatform/uno/blob/3fe3862b270b99dbec4d830b547942af61b1a1d9/src/Uno.UI/UI/Xaml/UIElement.cs#L1015-L1023
#if WINAPPSDK && !HAS_UNO
#if WINUI3
// Need to wait until we're at least applying template step of loading before setting Cursor
// See https://github.com/microsoft/microsoft-ui-xaml/issues/7062
if (gripper._appliedTemplate &&
Expand Down
5 changes: 2 additions & 3 deletions components/Sizers/src/SizerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ protected override AutomationPeer OnCreateAutomationPeer()
return new SizerAutomationPeer(this);
}

// On Uno the ProtectedCursor isn't supported yet, so we don't need this value.
#if WINAPPSDK && !HAS_UNO
#if WINUI3
// Used to track when we're in the OnApplyTemplateStep to change ProtectedCursor value.
private bool _appliedTemplate = false;
#endif
Expand Down Expand Up @@ -133,7 +132,7 @@ protected override void OnApplyTemplate()

// Trigger initial state transition based on if we're Enabled or not currently.
SizerBase_IsEnabledChanged(this, null!);
#if WINAPPSDK && !HAS_UNO
#if WINAPPSDK || HAS_UNO_WINUI
Arlodotexe marked this conversation as resolved.
Show resolved Hide resolved
// On WinAppSDK, we'll trigger this to setup the initial ProtectedCursor value.
_appliedTemplate = true;
#endif
Expand Down
Loading