Skip to content

Commit 5a995b9

Browse files
authored
Update Uno version, Uno TFMs to .NET 8 (#422)
* Update tooling pointer * Fixed new net8.0 compiler warnings/errors * Update tooling pointer * Align Android TFM with Uno.UI * Use net8.0-android34.0 for Android TFM * Fixed possible nullrefs on wasdk * Fixed possible nullrefs on WinAppSdk * Fixed WinUIMajorVersion for single-component Wasdk head * Update tooling pointer to latest main
1 parent 9fae7ac commit 5a995b9

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

components/Animations/src/Extensions/CompositorExtensions.cs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ public static BooleanKeyFrameAnimation CreateBooleanKeyFrameAnimation(
109109
animation.InsertKeyFrame(0, from.Value);
110110
}
111111

112-
animation.Target = target;
112+
if (target is not null)
113+
animation.Target = target;
114+
113115
animation.Direction = direction;
114116
animation.IterationBehavior = iterationBehavior;
115117
animation.IterationCount = iterationCount;
@@ -170,7 +172,9 @@ public static ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation(
170172
animation.InsertKeyFrame(0, from.Value);
171173
}
172174

173-
animation.Target = target;
175+
if (target is not null)
176+
animation.Target = target;
177+
174178
animation.Direction = direction;
175179
animation.IterationBehavior = iterationBehavior;
176180
animation.IterationCount = iterationCount;
@@ -231,7 +235,9 @@ public static Vector2KeyFrameAnimation CreateVector2KeyFrameAnimation(
231235
animation.InsertKeyFrame(0, from.Value);
232236
}
233237

234-
animation.Target = target;
238+
if (target is not null)
239+
animation.Target = target;
240+
235241
animation.Direction = direction;
236242
animation.IterationBehavior = iterationBehavior;
237243
animation.IterationCount = iterationCount;
@@ -292,7 +298,9 @@ public static Vector3KeyFrameAnimation CreateVector3KeyFrameAnimation(
292298
animation.InsertKeyFrame(0, from.Value);
293299
}
294300

295-
animation.Target = target;
301+
if (target is not null)
302+
animation.Target = target;
303+
296304
animation.Direction = direction;
297305
animation.IterationBehavior = iterationBehavior;
298306
animation.IterationCount = iterationCount;
@@ -353,7 +361,9 @@ public static Vector4KeyFrameAnimation CreateVector4KeyFrameAnimation(
353361
animation.InsertKeyFrame(0, from.Value);
354362
}
355363

356-
animation.Target = target;
364+
if (target is not null)
365+
animation.Target = target;
366+
357367
animation.Direction = direction;
358368
animation.IterationBehavior = iterationBehavior;
359369
animation.IterationCount = iterationCount;
@@ -414,7 +424,9 @@ public static ColorKeyFrameAnimation CreateColorKeyFrameAnimation(
414424
animation.InsertKeyFrame(0, from.Value);
415425
}
416426

417-
animation.Target = target;
427+
if (target is not null)
428+
animation.Target = target;
429+
418430
animation.Direction = direction;
419431
animation.IterationBehavior = iterationBehavior;
420432
animation.IterationCount = iterationCount;
@@ -475,7 +487,9 @@ public static QuaternionKeyFrameAnimation CreateQuaternionKeyFrameAnimation(
475487
animation.InsertKeyFrame(0, from.Value);
476488
}
477489

478-
animation.Target = target;
490+
if (target is not null)
491+
animation.Target = target;
492+
479493
animation.Direction = direction;
480494
animation.IterationBehavior = iterationBehavior;
481495
animation.IterationCount = iterationCount;

components/Extensions/src/Element/FrameworkElementExtensions.Mouse.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ private static void Element_PointerEntered(object sender, PointerRoutedEventArgs
101101
CursorShape cursor = GetCursor((FrameworkElement)sender);
102102

103103
#if !WINAPPSDK
104+
if (Window.Current?.CoreWindow is not null)
104105
Window.Current.CoreWindow.PointerCursor = _cursors[cursor];
105106
#endif
106107
}
@@ -124,6 +125,7 @@ private static void Element_PointerExited(object sender, PointerRoutedEventArgs
124125
}
125126

126127
#if !WINAPPSDK
128+
if (Window.Current?.CoreWindow is not null)
127129
Window.Current.CoreWindow.PointerCursor = cursor;
128130
#endif
129131
}
@@ -138,6 +140,7 @@ private static void ElementOnUnloaded(object sender, RoutedEventArgs routedEvent
138140
// when the element is programatically unloaded, reset the cursor back to default
139141
// this is necessary when click triggers immediate change in layout and PointerExited is not called
140142
#if !WINAPPSDK
143+
if (Window.Current?.CoreWindow is not null)
141144
Window.Current.CoreWindow.PointerCursor = _defaultCursor;
142145
#endif
143146
}

components/Helpers/src/ThemeListener.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public ThemeListener(DispatcherQueue? dispatcherQueue = null)
7676

7777
DispatcherQueue = dispatcherQueue ?? DispatcherQueue.GetForCurrentThread();
7878

79-
if (Window.Current != null)
79+
if (Window.Current?.CoreWindow is not null)
8080
{
8181
_accessible.HighContrastChanged += Accessible_HighContrastChanged;
8282
_settings.ColorValuesChanged += Settings_ColorValuesChanged;
@@ -163,7 +163,7 @@ public void Dispose()
163163
{
164164
_accessible.HighContrastChanged -= Accessible_HighContrastChanged;
165165
_settings.ColorValuesChanged -= Settings_ColorValuesChanged;
166-
if (Window.Current != null)
166+
if (Window.Current?.CoreWindow is not null)
167167
{
168168
Window.Current.CoreWindow.Activated -= CoreWindow_Activated;
169169
}

0 commit comments

Comments
 (0)