Exemple #1
0
        public MainPage()
        {
            InitializeComponent();
            ThisPage = this;
            Window.Current.SetTitleBar(TitleBar);
            Loaded += MainPage_Loaded;
            Loaded += MainPage_Loaded1;
            CurrentInstanceGuid       = ApplicationData.Current.LocalSettings.Values["LastActiveGuid"] as string;
            Window.Current.Activated += MainPage_Activated;
            Application.Current.EnteredBackground += Current_EnteredBackground;
            Application.Current.LeavingBackground += Current_LeavingBackground;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested;
            SystemNavigationManager.GetForCurrentView().BackRequested         += MainPage_BackRequested;

            try
            {
                ToastNotificationManager.History.Clear();
            }
            catch (Exception)
            {
            }

            if (Package.Current.IsDevelopmentMode)
            {
                AppName.Text += " (Development Mode)";
            }
        }
        public Shell()
        {
            InitializeComponent();

            DataContextChanged += (s, e) =>
            {
                Bindings.Update();
            };

            SolutionExplorerTabView.TabItemsChanged += (s, e) => SolutionExplorerColumnDefinition.Width = GridLength.Auto;

            TitleBarShadow.Receivers.Add(ContentPanel);
            SolutionExplorerShadow.Receivers.Add(MainEditorPanel);
            TerminalShadow.Receivers.Add(ContentEditorPanel);

            TitleBarPanel.Translation         += new Vector3(0.0f, 0.0f, 32.0f);
            SolutionExplorerPanel.Translation += new Vector3(0.0f, 0.0f, 32.0f);
            TerminalPanel.Translation         += new Vector3(0.0f, 0.0f, 32.0f);

            CoreApplicationViewTitleBar titleBar = CoreApplication.GetCurrentView().TitleBar;

            UpdateTitleBarLayout(titleBar);

            titleBar.LayoutMetricsChanged += (s, e) => UpdateTitleBarLayout(s);

            Window.Current.SetTitleBar(CustomDragRegion);

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequested;
        }
Exemple #3
0
        public MainPage()
        {
            this.InitializeComponent();

            ApplicationView.PreferredLaunchViewSize      = new Size(800, 1200);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            ListView_Processes.ItemsSource = Global.ProcessList;

            if (ApiInformation.IsApiContractPresent(
                    "Windows.ApplicationModel.FullTrustAppContract", 1, 0))
            {
                FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
            }


            //SendToWinForms();

            /*ValueSet request = new ValueSet();
             * request.Add("KEY", "key");
             * App.SendToWinForms(request);*/

            // Hook Window Close

            SystemNavigationManagerPreview mgr =
                SystemNavigationManagerPreview.GetForCurrentView();

            mgr.CloseRequested += SystemNavigationManager_CloseRequested;

            // Hook Minimize
            Window.Current.VisibilityChanged += new WindowVisibilityChangedEventHandler(Minimize_Hook);
        }
Exemple #4
0
        public MainViewModel(ISettingsService settingsService, ITrayProcessCommunicationService trayProcessCommunicationService, IDialogService dialogService, IKeyboardCommandService keyboardCommandService)
        {
            _settingsService = settingsService;
            _settingsService.CurrentThemeChanged        += OnCurrentThemeChanged;
            _settingsService.ApplicationSettingsChanged += OnApplicationSettingsChanged;
            _trayProcessCommunicationService             = trayProcessCommunicationService;
            _dialogService          = dialogService;
            _keyboardCommandService = keyboardCommandService;
            _keyboardCommandService.RegisterCommandHandler(Command.NewTab, () => AddTerminal(null));
            _keyboardCommandService.RegisterCommandHandler(Command.CloseTab, CloseCurrentTab);
            _keyboardCommandService.RegisterCommandHandler(Command.NextTab, SelectNextTab);
            _keyboardCommandService.RegisterCommandHandler(Command.PreviousTab, SelectPreviousTab);
            _keyboardCommandService.RegisterCommandHandler(Command.NewWindow, NewWindow);
            _keyboardCommandService.RegisterCommandHandler(Command.ShowSettings, ShowSettings);
            var currentTheme = _settingsService.GetCurrentTheme();

            Background           = currentTheme.Colors.Background;
            BackgroundOpacity    = currentTheme.BackgroundOpacity;
            _applicationSettings = _settingsService.GetApplicationSettings();

            AddTerminalCommand  = new RelayCommand(() => AddTerminal(null));
            ShowSettingsCommand = new RelayCommand(ShowSettings);

            Terminals.CollectionChanged += OnTerminalsCollectionChanged;

            Title = "Fluent Terminal";

            _dispatcher = CoreApplication.GetCurrentView().Dispatcher;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequest;
        }
Exemple #5
0
        public Player()
        {
            this.InitializeComponent();
            systemControls = mediaPlayer.SystemMediaTransportControls;
            mediaPlayer.CommandManager.IsEnabled = false;

            // Register to handle the following system transpot control buttons.
            systemControls.ButtonPressed += SystemControls_ButtonPressed;

            //  mediaPlayer.CurrentStateChanged += MediaElement_CurrentStateChanged;


            systemControls.IsPlayEnabled  = true;
            systemControls.IsPauseEnabled = true;


            myMediaPlayer.SetMediaPlayer(mediaPlayer);
            var mediaSource = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/梨花雨.mp4"));

            mediaSource.OpenOperationCompleted += MediaSource_OpenOperationCompleted;
            myMediaPlayer.Source = mediaSource;
            mediaPlayer.CommandManager.IsEnabled = false;
            mediaPlayer.TimelineController       = mediaTimelineController;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest;
            //SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequest;
            Window.Current.Closed += (ss, ee) =>
            {
                // stopMediaPlayer();
            };
            Window.Current.Activated += (s, e) =>
            {
                // startOrPause(null, null);
            };
            Loaded += Player_Loaded;
        }
Exemple #6
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            bool permissionGained = await Speech.AudioCapturePermissions.RequestMicrophonePermission();

            if (!permissionGained)
            {
                var dialog = new MicPermissionDialog();
                var result = await dialog.ShowAsync();

                if (result == ContentDialogResult.Primary)
                {
                    await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-microphone"));
                }

                Application.Current.Exit();

                return;
            }

            await Utils.JumpListMenu.Clear();

            await Utils.JumpListMenu.Add("/Exit", "Exit Application", "ms-appx:///Assets/Square44x44Logo.altform-unplated_targetsize-256.png");

            // override close baehavior when user attempts to close the app while we are recording
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequested;
        }
Exemple #7
0
            public override bool WindowShouldClose(NSObject sender)
            {
                var manager = SystemNavigationManagerPreview.GetForCurrentView();

                if (!manager.HasConfirmedClose)
                {
                    manager.OnCloseRequested();
                    if (!manager.HasConfirmedClose)
                    {
                        // Close was either deferred or canceled synchronously.
                        return(false);
                    }
                }

                // closing should continue, perform suspension

                if (!Application.Current.Suspended)
                {
                    Application.Current.OnSuspending();
                    return(Application.Current.Suspended);
                }

                // all prerequisites passed, can safely close
                return(true);
            }
Exemple #8
0
        public MainPage()
        {
            _instance = this;
            this.InitializeComponent();
            for (int i = 0; i < 8; i++)
            {
                g_RecentColor[i] = new RecentColor();
            }
            Window.Current.CoreWindow.KeyDown     += CoreWindow_KeyDown;
            Window.Current.CoreWindow.KeyUp       += CoreWindow_KeyUp;
            Window.Current.CoreWindow.SizeChanged += CoreWindow_SizeChanged;
            g_PressShift = false;
            g_PressCtrl  = false;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest;
            g_LocalSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            // EffectBlocks
            for (int i = 0; i < GetCommonEffects().Length; i++)
            {
                EffectBlockListView.Items.Add(i);
            }

            oldSortingPositions = new Dictionary <DeviceModel, Point>();

            if (FileListButtonContent.Text.ToString() == "")
            {
                RenameItem.IsEnabled = false;
                DeleteItem.IsEnabled = false;
            }
        }
        public MainPage()
        {
            this.InitializeComponent();
            Current          = this;
            SampleTitle.Text = FEATURE_NAME;
            ApplicationDataContainer localSettings = null;

            localSettings = ApplicationData.Current.LocalSettings;

            // 첫 실행시  자동 설정
            if (localSettings == null)
            {
                int[]  resolution         = SettingValue.GetInstance().GetResolution();
                double actualSizeInInches = Double.MaxValue;
                if (DisplayInformation.GetForCurrentView().DiagonalSizeInInches.HasValue)
                {
                    actualSizeInInches = DisplayInformation.GetForCurrentView().DiagonalSizeInInches.Value;
                }
                double d = resolution[0] ^ 2 + resolution[1] ^ 2;
                d = actualSizeInInches / Math.Sqrt(d);
                int[] a = { (int)(d * resolution[0]), (int)(d * resolution[1]) };
                SettingValue.GetInstance().SetScreenSize(a);
            }

            SystemNavigationManagerPreview mgr =
                SystemNavigationManagerPreview.GetForCurrentView();

            mgr.CloseRequested += SystemNavigationManager_CloseRequested;
            Systrayicon();
            //BackBaseTask();
        }
Exemple #10
0
        public MainPage()
        {
            InitializeThings();
            InitializeComponent();

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += App_CloseRequested;
        }
Exemple #11
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += App_CloseRequested;
            RegisterExceptionHandlingSynchronizationContext();

            if (args.Kind == ActivationKind.Protocol)
            {
                if (Window.Current.Content == null)
                {
                    CreateRootFrame(ApplicationExecutionState.NotRunning);

                    rootFrame.Navigate(typeof(MainPage));

                    Window.Current.Activate();
                }

                var a   = args as ProtocolActivatedEventArgs;
                var uri = a.Uri;

                if (uri != null)
                {
                    var volnum = uri.Query.Replace("?volnum=", "");
                    MainPage.Current?.NavigateByVolNum(volnum);
                }
            }
            else
            {
                Window.Current.Activate();
            }
        }
Exemple #12
0
        private async Task LaunchApplicationAsync(string page, object launchParam)
        {
            CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;

            coreTitleBar.ExtendViewIntoTitleBar = true;

            await ThemeSelectorService.SetRequestedThemeAsync();

            NavigationService.Navigate(page, launchParam);
            Window.Current.Activate();

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += (s, e) =>
            {
                NotificationManager.Current.IsEnabled = false;
                NotificationManager.Current.RemoveBreakFinishedToastNotificationSchedule();
                NotificationManager.Current.RemovePomodoroFinishedToastNotificationSchedule();
            };
            NotificationManager.Current.RemoveBreakFinishedToastNotificationSchedule();
            NotificationManager.Current.RemovePomodoroFinishedToastNotificationSchedule();
            //var dialog = new Views.FirstRunDialog();
            //await dialog.ShowAsync();
            //await Container.Resolve<IWhatsNewDisplayService>().ShowIfAppropriateAsync();
            await Container.Resolve <IFirstRunDisplayService>().ShowIfAppropriateAsync();

            //Container.Resolve<ILiveTileService>().SampleUpdate();
            //Container.Resolve<IToastNotificationsService>().ShowToastNotificationSample();
        }
        public MainPage(object Parameter)
        {
            InitializeComponent();
            ThisPage = this;
            Window.Current.SetTitleBar(TitleBar);
            Application.Current.FocusVisualKind = FocusVisualKind.Reveal;
            Loaded += MainPage_Loaded;
            Loaded += MainPage_Loaded1;
            Window.Current.Activated += MainPage_Activated;
            Application.Current.EnteredBackground += Current_EnteredBackground;
            Application.Current.LeavingBackground += Current_LeavingBackground;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested;
            SystemNavigationManager.GetForCurrentView().BackRequested         += MainPage_BackRequested;

            BackgroundController.Current.SetAcrylicEffectPresenter(CompositorAcrylicBackground);

            if (Package.Current.IsDevelopmentMode)
            {
                AppName.Text += " (Development Mode)";
            }

            if (Parameter is Tuple <Rect, string[]> Paras)
            {
                ActivatePathArray = Paras.Item2;

                if (!AnimationController.Current.IsDisableStartupAnimation && ActivatePathArray.Length == 0)
                {
                    EntranceEffectProvider = new EntranceAnimationEffect(this, Nav, Paras.Item1);
                    EntranceEffectProvider.PrepareEntranceEffect();
                }
            }
        }
Exemple #14
0
 public MainPage()
 {
     this.InitializeComponent();
     vm = new HomeViewModel();
     SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += App_CloseRequested;
     Window.Current.Activate();
 }
Exemple #15
0
        public ApplicationViewAdapter()
        {
            _applicationView = ApplicationView.GetForCurrentView();
            _dispatcher      = CoreApplication.GetCurrentView().Dispatcher;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequest;

            Logger.Instance.Debug("Created ApplicationViewAdapter for ApplicationView with Id: {Id}", _applicationView.Id);
        }
Exemple #16
0
        public MainPage()
        {
            this.InitializeComponent();

            LoadApplication(new SINTEF.AutoActive.UI.App());

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += OnCloseRequested;
        }
Exemple #17
0
 public MainPage() : base()
 {
     this.InitializeComponent();
     TitleBox.Text       = "Untitled";
     vm.IsTimingChanged += IsTiming_Changed;
     vm.CurrentSelectedFolderChanged += CurrentSelectedFolder_Changed;
     SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += CloseRequested;
 }
Exemple #18
0
        public EditorPage()
        {
            this.InitializeComponent();
            SetupCapture();

            SystemNavigationManagerPreview.GetForCurrentView()
            .CloseRequested += OnWindowCloseRequested;
        }
Exemple #19
0
        public MainPageVM()
        {
            DoToggleHamburger = new RelayCommand(ToggleHamburger);
            DoLogout          = new RelayCommand(Logout);

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest;
            NavigationHandler.NavigationOccured += UpdateNavigationButtons;
        }
Exemple #20
0
 public MainPage()
 {
     this.InitializeComponent();
     Window.Current.SetTitleBar(TitleBar);
     DetactIsFirstRunORNot();
     AddTab(this, null);
     SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += AppClosingConfirm;
 }
        public MainPage()
        {
            this.InitializeComponent();

            SystemNavigationManagerPreview mgr =
                SystemNavigationManagerPreview.GetForCurrentView();

            mgr.CloseRequested += SystemNavigationManager_CloseRequested;
        }
Exemple #22
0
        public MainPage()
        {
            this.InitializeComponent();
            UndoStrokes = new Stack <InkStroke>();
            canvas.InkPresenter.StrokesErased             += Stroke_Erased;
            canvas.InkPresenter.StrokeInput.StrokeStarted += Stroke_Started;

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += Close_Requested;
        }
Exemple #23
0
        /// <summary>
        /// Initialize a new instance of the <see cref="MainPage"/> class.
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested;

            Unloaded += MainPage_Unloaded;
            ViewModel.InitializeAsync(ContentFrame).Forget();
        }
Exemple #24
0
        public async Task ActivateAsync(object activationArgs)
        {
            if (IsInteractive(activationArgs))
            {
                // Initialize things like registering background task before the app is loaded
                await InitializeAsync();

                // Do not repeat app initialization when the Window already has content,
                // just ensure that the window is active
                if (Window.Current.Content == null)
                {
                    // Create a Frame to act as the navigation context and navigate to the first page
                    Window.Current.Content              = _shell?.Value ?? new Frame();
                    NavigationService.NavigationFailed += (sender, e) =>
                    {
                        throw e.Exception;
                    };
                    NavigationService.Navigated += Frame_Navigated;
                    if (SystemNavigationManager.GetForCurrentView() != null)
                    {
                        SystemNavigationManager.GetForCurrentView().BackRequested += ActivationService_BackRequested;

                        // Stuff for popping a confirmation dialog before closing
                        SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += App_CloseRequested;
                    }
                }
            }

            var activationHandler = GetActivationHandlers()
                                    .FirstOrDefault(h => h.CanHandle(activationArgs));

            if (activationHandler != null)
            {
                await activationHandler.HandleAsync(activationArgs);
            }

            if (IsInteractive(activationArgs))
            {
                var defaultHandler = new DefaultLaunchActivationHandler(_defaultNavItem);
                if (defaultHandler.CanHandle(activationArgs))
                {
                    await defaultHandler.HandleAsync(activationArgs);
                }

                // Set custom stuff
                SetTitlebar();
                SetMinimalWindowSize();
                // Maximize UI on Xbox (Disabled, only here for testing)
                //Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);

                // Ensure the current window is active
                Window.Current.Activate();

                // Tasks after activation
                await StartupAsync();
            }
        }
Exemple #25
0
        public WindowsPage()
        {
            this.InitializeComponent();

            _instance = this;

            WindowsFrame.Navigated += WindowsFrame_Navigated;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest;
            g_WindowsLocalSettings = ApplicationData.Current.LocalSettings;
        }
        public MainPage()
        {
            this.InitializeComponent();
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += CloseHandle;

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current          = this;
            SampleTitle.Text = FEATURE_NAME;
        }
Exemple #27
0
 public MainPage()
 {
     this.InitializeComponent();
     // hide the main menu
     this.MenuColumn.Width = new GridLength(0);
     ActionRouter.SetUp();
     // prevent the application from closing when the user hits the x button. This will alarms and notifications to still trigger
     SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += CloseHandle;
     Window.Current.SizeChanged += SizeChangedHandler;
 }
Exemple #28
0
        private bool outputting = false;               // データの書き出し中はtrue

        public MainPage()
        {
            this.InitializeComponent();
            ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(600, 600));
            ApplicationView.PreferredLaunchViewSize      = new Size(600, 600);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested;

            StoreData sd = new StoreData();
        }
Exemple #29
0
        private int cameraStatus      = 0; // 0: stop, 1: active, 2: rec

        public CameraViewPage()
        {
            this.InitializeComponent();
            DeviceSelect();
            Application.Current.Suspending += Application_Suspending;

            // Pageを閉じるときに確認ダイアログを出す
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += CameraViewPage_CloseRequested;

            SetupTimer();
        }
Exemple #30
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            mMediaPlayer = new MediaPlayer();
            videoPlayer.SetMediaPlayer(mMediaPlayer);
            App.Current.Suspending += OnSuspending;
            DataContext             = this;

            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += (s, a) =>
            {
                Debug.WriteLine("MainPage Close Requested");
            };
        }