Skip to content

Commit c532c11

Browse files
fix: ProtectedCursor is now supported in Uno Platform (#433)
* fix: ProtectedCursor is now supported in Uno Platform * Update components/Sizers/src/SizerBase.Properties.cs * Update components/Sizers/src/SizerBase.cs --------- Co-authored-by: Arlo <arlo.godfrey@outlook.com>
1 parent 815d629 commit c532c11

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

components/Sizers/src/SizerBase.Properties.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ private static void OnOrientationPropertyChanged(DependencyObject d, DependencyP
132132
return;
133133
#endif
134134

135-
// TODO: [UNO] Only supported on certain platforms
136-
// See ProtectedCursor here: https://github.com/unoplatform/uno/blob/3fe3862b270b99dbec4d830b547942af61b1a1d9/src/Uno.UI/UI/Xaml/UIElement.cs#L1015-L1023
137-
#if WINAPPSDK && !HAS_UNO
135+
#if WINUI3
138136
// Need to wait until we're at least applying template step of loading before setting Cursor
139137
// See https://github.com/microsoft/microsoft-ui-xaml/issues/7062
140138
if (gripper._appliedTemplate &&

components/Sizers/src/SizerBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ protected override AutomationPeer OnCreateAutomationPeer()
100100
return new SizerAutomationPeer(this);
101101
}
102102

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

134133
// Trigger initial state transition based on if we're Enabled or not currently.
135134
SizerBase_IsEnabledChanged(this, null!);
136-
#if WINAPPSDK && !HAS_UNO
135+
#if WINUI3
137136
// On WinAppSDK, we'll trigger this to setup the initial ProtectedCursor value.
138137
_appliedTemplate = true;
139138
#endif

0 commit comments

Comments
 (0)