Example #1
0
 public void Attach(DependencyObject associatedObject)
 {
     AssociatedObject = associatedObject;
     _dispatcher      = WindowExManager.Current().Dispatcher;
     Central.Messenger.Subscribe <Messages.BackRequestedMessage>(this, e =>
     {
         Interaction.ExecuteActions(AssociatedObject, Actions, null);
     });
 }
Example #2
0
 public NavButtonBehavior()
 {
     if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled)
     {
         _dispatcher     = WindowExManager.Current().Dispatcher;
         _throttleHelper = new EventThrottleHelper {
             Throttle = 1000
         };
     }
 }
Example #3
0
        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;
 }
Example #5
0
 public static async Task <ContentDialogResult> ShowAsyncEx(this ContentDialog contentDialog, IDispatcherEx dispatcher = null)
 => await ShowAsync(async() => await contentDialog.ShowAsync(), dispatcher);
Example #6
0
        /*
         * 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);