Skip to content

Commit

Permalink
chore: Tunneling events, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Oct 5, 2024
1 parent 775520f commit e078c35
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ await RunOnUIThread(() =>
}

[TestMethod]
[Ignore("The first verify fails as ComboBox pre-selects index 0 due to SelectionChangedTrigger.Always #17988")]
[Ignore("The first verify fails as ComboBox pre-selects index 0 due to SelectionChangedTrigger.Always. This is likely a new behavior! #17988")]
public async Task ValidateKeyboardInteraction()
{
var comboBox = await SetupBasicComboBoxTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ partial class Selector
// m_focusedIndex to make it easier to track when this field is read & written.
private protected int GetFocusedIndex() => m_focusedIndex;

void SetFocusedIndex(int focusedIndex)
internal void SetFocusedIndex(int focusedIndex)
{
if (m_focusedIndex != focusedIndex)
{
Expand Down
16 changes: 16 additions & 0 deletions src/Uno.UI/UI/Xaml/UIElement.RoutedEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,22 @@ internal bool SafeRaiseEvent(RoutedEvent routedEvent, RoutedEventArgs args, Bubb
}
}

internal bool SafeRaiseTunnelingEvent(RoutedEvent routedEvent, RoutedEventArgs args)
{
try
{
RaiseTunnelingEvent(routedEvent, args);
return true;
}
catch (Exception e)
{
if (this.Log().IsEnabled(LogLevel.Error))
{
this.Log().Error($"Failed to raise '{routedEvent.Name}': {e}");
}
return false;
}
}

/// <summary>
/// Raise a routed event
Expand Down

0 comments on commit e078c35

Please sign in to comment.