public void Attach(DependencyObject associatedObject) { AssociatedObject = associatedObject; _dispatcher = WindowExManager.Current().Dispatcher; Central.Messenger.Subscribe <Messages.BackRequestedMessage>(this, e => { Interaction.ExecuteActions(AssociatedObject, Actions, null); }); }
public NavButtonBehavior() { if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) { _dispatcher = WindowExManager.Current().Dispatcher; _throttleHelper = new EventThrottleHelper { Throttle = 1000 }; } }
private static async Task <T> ShowAsync <T>(Func <Task <T> > show, IDispatcherEx dispatcher) { await _showAsyncSemaphoreSlim.WaitAsync(); try { dispatcher = dispatcher ?? WindowEx.Current().Dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); return(await dispatcher.DispatchAsync(async() => await show())); } finally { _showAsyncSemaphoreSlim.Release(); } }
public void Attach(DependencyObject associatedObject) { AssociatedObject = associatedObject; _dispatcher = WindowEx.Current().Dispatcher; _BackButtonService.BackRequested += BackButtonService_NavigateBack; }
public static async Task <ContentDialogResult> ShowAsyncEx(this ContentDialog contentDialog, IDispatcherEx dispatcher = null) => await ShowAsync(async() => await contentDialog.ShowAsync(), dispatcher);
/* * Safely show dialogs without overlapping them, which is not allowed in WinRT */ public static async Task <IUICommand> ShowAsyncEx(this MessageDialog messageDialog, IDispatcherEx dispatcher = null) => await ShowAsync(async() => await messageDialog.ShowAsync(), dispatcher);