Skip to content

Commit

Permalink
fix: Invert Debug.Asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Apr 19, 2024
1 parent 45b7c39 commit f83695f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@ internal bool RaiseEvent(RoutedEvent routedEvent, RoutedEventArgs args, Bubbling
#if TRACE_ROUTED_EVENT_BUBBLING
global::System.Diagnostics.Debug.Write($"{this.GetDebugIdentifier()} - [{routedEvent.Name.TrimEnd("Event")}-{args?.GetHashCode():X8}] (ctx: {ctx}){(this is Microsoft.UI.Xaml.Controls.ContentControl ctrl ? ctrl.DataContext : "")}\r\n");
#endif
global::System.Diagnostics.Debug.Assert(routedEvent.Flag == RoutedEventFlag.None, $"Flag not defined for routed event {routedEvent.Name}.");
global::System.Diagnostics.Debug.Assert(routedEvent.Flag != RoutedEventFlag.None, $"Flag not defined for routed event {routedEvent.Name}.");

#if !__WASM__
global::System.Diagnostics.Debug.Assert(routedEvent.IsTunnelingEvent, $"Tunneling event {routedEvent.Name} should be raised through {nameof(RaiseTunnelingEvent)}");
global::System.Diagnostics.Debug.Assert(!routedEvent.IsTunnelingEvent, $"Tunneling event {routedEvent.Name} should be raised through {nameof(RaiseTunnelingEvent)}");
#endif

// TODO: This is just temporary workaround before proper
Expand Down Expand Up @@ -694,7 +694,7 @@ internal bool RaiseEvent(RoutedEvent routedEvent, RoutedEventArgs args, Bubbling
/// </summary>
internal void RaiseTunnelingEvent(RoutedEvent routedEvent, RoutedEventArgs args)
{
global::System.Diagnostics.Debug.Assert(!routedEvent.IsTunnelingEvent, $"Event {routedEvent.Name} is not marked as a tunneling event.");
global::System.Diagnostics.Debug.Assert(routedEvent.IsTunnelingEvent, $"Event {routedEvent.Name} is not marked as a tunneling event.");

// TODO: This is just temporary workaround before proper
// keyboard event infrastructure is implemented everywhere
Expand Down

0 comments on commit f83695f

Please sign in to comment.