Пример #1
0
        protected virtual void OnActivated(object sender, UI.Xaml.WindowActivatedEventArgs args)
        {
            if (args.WindowActivationState != UI.Xaml.WindowActivationState.Deactivated)
            {
                if (_enableResumeEvent)
                {
                    MauiWinUIApplication.Current.Services?.InvokeLifecycleEvents <WindowsLifecycle.OnResumed>(del => del(this));
                }
                else
                {
                    _enableResumeEvent = true;
                }
            }

            MauiWinUIApplication.Current.Services?.InvokeLifecycleEvents <WindowsLifecycle.OnActivated>(del => del(this, args));
        }
Пример #2
0
        public static void OnActivated(UI.Xaml.Window window, UI.Xaml.WindowActivatedEventArgs e)
        {
            // When the native control gallery loads up, it'll let us know so we can add the nested native controls
            MessagingCenter.Subscribe <NestedNativeControlGalleryPage>(window, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);

            // When the native binding gallery loads up, it'll let us know so we can set up the native bindings
            MessagingCenter.Subscribe <NativeBindingGalleryPage>(window, NativeBindingGalleryPage.ReadyForNativeBindingsMessage, AddNativeBindings);

            Application.Current.PropertyChanged += OnAppPropertyChanged;

            WireUpKeyDown(window);

            void OnAppPropertyChanged(object sender, global::System.ComponentModel.PropertyChangedEventArgs e)
            {
                if (e.PropertyName == nameof(Application.MainPage))
                {
                    WireUpKeyDown(window);
                }
            }
        }
Пример #3
0
 protected virtual void OnActivated(object sender, UI.Xaml.WindowActivatedEventArgs args)
 {
     MauiWinUIApplication.Current.Services?.InvokeLifecycleEvents <WindowsLifecycle.OnActivated>(del => del(this, args));
 }