public App() { InitializeComponent(); MainPage = new ShellPage(); MainPage.Navigation.PushModalAsync(new LoginPage()); }
public PowerLauncherViewModel() { callback = (PowerLauncherSettings settings) => { // Propagate changes to Power Launcher through IPC ShellPage.DefaultSndMSGCallback( string.Format("{{ \"powertoys\": {{ \"{0}\": {1} }} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings))); }; if (SettingsUtils.SettingsExists(PowerLauncherSettings.POWERTOYNAME)) { settings = SettingsUtils.GetSettings <PowerLauncherSettings>(PowerLauncherSettings.POWERTOYNAME); } else { settings = new PowerLauncherSettings(); settings.properties.open_powerlauncher.Alt = true; settings.properties.open_powerlauncher.Code = (int)Windows.System.VirtualKey.Space; settings.properties.maximum_number_of_results = 4; callback(settings); } if (SettingsUtils.SettingsExists()) { generalSettings = SettingsUtils.GetSettings <GeneralSettings>(); } else { generalSettings = new GeneralSettings(); } }
private void Page_Load(object sender, EventArgs e) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(e, "e"); if (!ShellPage.IsLoggedIn()) { return; } var s = string.Empty; switch (WebUtil.GetQueryString("cmd").ToLowerInvariant()) { case "gettreeviewchildren": s = GetTreeViewChildren(); break; case "expandtreeviewtonode": s = ExpandTreeViewToNode(); break; case "getcontextualtabs": s = GetContextualTabs(); break; case "convert": s = DesignTimeConvert(); break; case "treeviewcontent": s = GetTreeViewContent(); break; } Response.Write(s); }
protected override UIElement CreateShell(Frame rootFrame) { ShellPage shell = this.Container.Resolve <ShellPage>(); shell.SetRootFrame(rootFrame); return(shell); }
private static void SpawnSecondaryPanel(GameObject secondaryPanel) { songItemPanel = secondaryPanel.GetComponent <ShellPage>(); songItemPanel.SetPageActive(true, true); songItemPanel.gameObject.transform.GetChild(0).GetChild(1).gameObject.SetActive(false); // Removes the back button MelonCoroutines.Start(WaitForSpawningMenu(secondaryPanel)); }
public static void CreatePanel() { panelCreated = true; GameObject HMXshellpage = GameObject.Find("ShellPage_Settings"); shellInstance = GameObject.Instantiate(HMXshellpage, DebugTextPosition, Quaternion.Euler(0, 100, 0)); shellInstance.name = "Custom_Page"; SP = shellInstance.GetComponent <ShellPage>(); Transform page = shellInstance.transform.GetChild(0); for (int i = 0; i < page.childCount; i++) { Transform child = page.GetChild(i); if (child.gameObject.name.Contains("backParent")) { child.gameObject.SetActive(false); } } Transform ShellPanelCenter = page.transform.GetChild(0); Transform Settings = ShellPanelCenter.transform.GetChild(2); Transform Options = Settings.transform.GetChild(0); OM = Options.GetComponent <OptionsMenu>(); MelonCoroutines.Start(SetPanelActive(true)); }
protected override void OnLaunched(LaunchActivatedEventArgs e) { var shell = new ShellPage(); Window.Current.Content = shell; Window.Current.Activate(); }
private void WindowsXamlHost_ChildChanged(object sender, EventArgs e) { // Hook up x:Bind source. WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost; ShellPage shellPage = windowsXamlHost.GetUwpInternalObject() as ShellPage; if (shellPage != null) { // send IPC Message shellPage.SetDefaultSndMessageCallback(msg => { //IPC Manager is null when launching runner directly Program.GetTwoWayIPCManager()?.Send(msg); }); // send IPC Message shellPage.SetRestartAdminSndMessageCallback(msg => { Program.GetTwoWayIPCManager().Send(msg); System.Windows.Application.Current.Shutdown(); // close application }); shellPage.SetElevationStatus(Program.IsElevated); shellPage.Refresh(); } }
public static IEnumerator GameplaySettingsMenuCoroutine() { if (shellInstance == null) { GameObject HMXshellpage = GameObject.Find("ShellPage_Settings"); shellInstance = GameObject.Instantiate(HMXshellpage, DebugTextPosition, Quaternion.Euler(0, 100, 0)); shellInstance.name = "Custom_Page"; SP = shellInstance.GetComponent <ShellPage>(); Transform page = shellInstance.transform.GetChild(0); for (int i = 0; i < page.childCount; i++) { Transform child = page.GetChild(i); if (child.gameObject.name.Contains("backParent")) { child.gameObject.SetActive(false); } } Transform ShellPanelCenter = page.transform.GetChild(0); Transform Settings = ShellPanelCenter.transform.GetChild(2); Transform Options = Settings.transform.GetChild(0); OM = Options.GetComponent <OptionsMenu>(); } SP.SetPageActive(true, true); yield return(new WaitForSeconds(0.005f)); OM.ShowPage(OptionsMenu.Page.Gameplay); }
public override UIElement CreateRootElement(IStartArgsEx e) { var shellPage = new ShellPage(); shellPage.MainNavView.Frame.RegisterNavigationService(); return(shellPage); }
public void RaisePropertyChanged([CallerMemberName] string propertyName = null) { OnPropertyChanged(propertyName); SndFancyZonesSettings outsettings = new SndFancyZonesSettings(Settings); SndModuleSettings <SndFancyZonesSettings> ipcMessage = new SndModuleSettings <SndFancyZonesSettings>(outsettings); ShellPage.DefaultSndMSGCallback(ipcMessage.ToJsonString()); }
public void NavigateToSection(Type type) { if (inst != null) { Activate(); ShellPage.Navigate(type); } }
protected override void OnLaunched(LaunchActivatedEventArgs e) { var shell = new ShellPage(); Services.NavigationService.Setup(shell.MainNavigationView); Window.Current.Content = shell; Window.Current.Activate(); }
private void WindowsXamlHost_ChildChanged(object sender, EventArgs e) { // Hook up x:Bind source. WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost; ShellPage shellPage = windowsXamlHost.GetUwpInternalObject() as ShellPage; if (shellPage != null) { // send IPC Message shellPage.SetDefaultSndMessageCallback(msg => { // IPC Manager is null when launching runner directly Program.GetTwoWayIPCManager()?.Send(msg); }); // send IPC Message shellPage.SetRestartAdminSndMessageCallback(msg => { Program.GetTwoWayIPCManager().Send(msg); System.Windows.Application.Current.Shutdown(); // close application }); // send IPC Message shellPage.SetCheckForUpdatesMessageCallback(msg => { Program.GetTwoWayIPCManager().Send(msg); }); // receive IPC Message Program.IPCMessageReceivedCallback = (string msg) => { if (ShellPage.ShellHandler.IPCResponseHandleList != null) { try { JsonObject json = JsonObject.Parse(msg); foreach (Action <JsonObject> handle in ShellPage.ShellHandler.IPCResponseHandleList) { handle(json); } } catch (Exception) { } } }; shellPage.SetElevationStatus(Program.IsElevated); shellPage.SetIsUserAnAdmin(Program.IsUserAnAdmin); shellPage.Refresh(); } // XAML Islands: If the window is open, explicity force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384 if (isOpen) { Show(); } }
public void RaisePropertyChanged([CallerMemberName] string propertyName = null) { // Notify UI of property change OnPropertyChanged(propertyName); OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(GeneralSettingsConfigs); ShellPage.DefaultSndMSGCallback(outsettings.ToString()); }
private void entranceInApp() { var shellPage = new ShellPage(); NavigationServiceFactory(shellPage); NavigationService.Navigating += shellPage.NavigationService_Navigating; NavigationService.Navigated += shellPage.NavigationService_Navigated; }
public static async Task FillCaches() { ShellPage.SetSpinner(LoadingState.Loading); if (cloud != null) { await FaultReportAccess.FillCaches(); } ShellPage.SetSpinner(LoadingState.Finished); }
protected override void OnLoad(EventArgs e) { Assert.ArgumentNotNull((object)e, nameof(e)); ShellPage.IsLoggedIn(true); base.OnLoad(e); ComponentArtGridHandler <PublishActivityItem> .Manage(this.PublishActivityGrid, (IGridSource <PublishActivityItem>) new GridSource <PublishActivityItem>(repository.GetAllPublishingItems()), this.RebindRequired); this.PublishActivityGrid.LocalizeGrid(); this.WriteLanguageAndBrowserCssClass(); }
public MainWindow(MainViewModel viewModel, ShellPage shellPage, IServiceProvider serviceProvider) { ViewModel = viewModel; InitializeComponent(); _shellPage = shellPage; _serviceProvider = serviceProvider; this.Activated += MainWindow_Activated; }
public void ConfigureAppPhase() { var shellPage = new ShellPage(); NavigationServiceFactory(shellPage); NavigationService.Navigating += shellPage.NavigationService_Navigating; NavigationService.Navigated += shellPage.NavigationService_Navigated; shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Dashboard); //Replace with better logic... }
private void RaisePropertyChanged([CallerMemberName] string propertyName = null) { // Notify UI of property change OnPropertyChanged(propertyName); if (ShellPage.DefaultSndMSGCallback != null) { SndPowerPreviewSettings snd = new SndPowerPreviewSettings(Settings); SndModuleSettings <SndPowerPreviewSettings> ipcMessage = new SndModuleSettings <SndPowerPreviewSettings>(snd); ShellPage.DefaultSndMSGCallback(ipcMessage.ToJsonString()); } }
public override UIElement CreateRootElement(IActivatedEventArgs e) { var service = NavigationServiceFactory(BackButton.Attach, ExistingContent.Exclude); ShellPage = new ShellPage(service); return(new ModalDialog { DisableBackButtonWhenModal = true, Content = ShellPage }); }
public async Task InitAsync() { ShellPage.SetSpinner(LoadingState.Loading); Templates = await faultReportAccess.GetFaultReportTemplates(); var triggers = await triggerAccess.GetSensorTriggersFor(Sensor.Id); Triggers = new ObservableCollection <SensorTriggerViewModel>( triggers.Select(t => new SensorTriggerViewModel(Sensor, t))); SelectedTrigger = Triggers.FirstOrDefault(); ShellPage.SetSpinner(LoadingState.Finished); }
// callback function to launch the URL to check for updates. private async void CheckForUpdates_Click() { GeneralSettings settings = SettingsUtils.GetSettings <GeneralSettings>(string.Empty); settings.CustomActionName = "check_for_updates"; OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings); GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings); if (ShellPage.CheckForUpdatesMsgCallback != null) { ShellPage.CheckForUpdatesMsgCallback(customaction.ToString()); } }
public void Restart_Elevated() { GeneralSettings settings = SettingsUtils.GetSettings <GeneralSettings>(string.Empty); settings.CustomActionName = "restart_elevation"; OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings); GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings); if (ShellPage.SndRestartAsAdminMsgCallback != null) { ShellPage.SndRestartAsAdminMsgCallback(customaction.ToString()); } }
public App() { BackgroundAggregatorService.Add(() => new PeriodicSevice(3)); //Start the background service BackgroundAggregatorService.StartBackgroundService(); InitializeComponent(); MainViewModel.GetInstance().About = new AboutViewModel(); MainViewModel.GetInstance().Search = new SearchViewModel(); DependencyService.Register <MockDataStore>(); //MainPage = new MainPage(); MainPage = new ShellPage(); }
private static void InstallSensorFaultHandler() { SensorAccess.Faulted += async(sensor, fault, timestamp) => { ShellPage.SetSpinner(LoadingState.Loading); var report = await SendFaultReport(sensor, fault, timestamp); ShellPage.SetSpinner(LoadingState.Finished); if (report == null) { return; } string shortDescription = "Sensor Triggered"; string longDescription = "Sensor has entered Triggered State!\n\n" + sensor.FaultString(fault); ShellPage.Current.AddNotificatoin(NotificationType.Warning, shortDescription, longDescription); }; }
public override async Task OnStartAsync(IStartArgs args) { if (args.StartKind == StartKinds.Launch && args.Arguments is ILaunchActivatedEventArgs e && e != null) { var shell = new ShellPage(e.SplashScreen); Window.Current.Content = shell; Window.Current.Activate(); await Task.Delay(1000); var frame = shell.MainFrame; var nav = NavigationFactory.Create(frame) .AttachGestures(Window.Current, Gesture.Refresh); await nav.NavigateAsync(nameof(SettingsPage)); } }
/// <summary> /// Checks the security. /// </summary> /// <exception cref="AccessDeniedException"> /// Application access denied. /// </exception> protected virtual void CheckSecurity() { ShellPage.IsLoggedIn(); var user = Context.User; if (user.IsAdministrator) { return; } var isDeveloping = user.IsInRole("sitecore\\Sitecore Client Developing"); var isMaintaining = user.IsInRole("sitecore\\Sitecore Client Maintaining"); var isAccessDenied = !isDeveloping && !isMaintaining; if (isAccessDenied) { throw new AccessDeniedException("Application access denied."); } }
public async Task ConfigureAppPhase() { try { var shellPage = new ShellPage(); NavigationServiceFactory(shellPage); NavigationService.Navigating += shellPage.NavigationService_Navigating; NavigationService.Navigated += shellPage.NavigationService_Navigated; //cliente if (Helpers.Settings.DisplayUserRole == UserRole.Client.ToString() || Helpers.Settings.DisplayUserRole == UserRole.Guest.ToString()) { await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Home); } //gerente if (Helpers.Settings.DisplayUserRole == UserRole.Manager.ToString()) { if (string.IsNullOrEmpty(Helpers.Settings.DisplayUserCompany)) { await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Empresas); } else { await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.ClientList); } } if (Helpers.Settings.DisplayUserRole == UserRole.Employee.ToString()) { await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.OrdersOpen); } } catch (Exception ex) { ex.ToString(); } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { // this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active ShellPage shellPage = Window.Current.Content as ShellPage; if (shellPage == null) { shellPage = new ShellPage(); if (rootFrame == null) { rootFrame = new Frame(); rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { } } shellPage.DataContext = rootFrame; Window.Current.Content = shellPage; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(WelcomePage)); } // Ensure the current window is active Window.Current.Activate(); }