public static void MapRequestDisplayDensity(IWindowHandler handler, IWindow window, object?args) { if (args is DisplayDensityRequest request) { request.SetResult(handler.PlatformView.GetDisplayDensity()); } }
public LobbyLoader(IWindowHandler windowHandler) { windowHandler.OpenWindow(WindowType.Characters); windowHandler.OpenWindow(WindowType.TopLobbyMenu); windowHandler.OpenWindow(WindowType.DownLobbyMenu); // windowHandler.OpenWindow(WindowType.Test); }
public static void MapContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var windowManager = handler.MauiContext.GetNavigationRootManager(); var previousRootView = windowManager.RootView; windowManager.Disconnect(); windowManager.Connect(handler.VirtualView.Content.ToPlatform(handler.MauiContext)); if (handler.PlatformView.Content is WindowRootViewContainer container) { if (previousRootView != null && previousRootView != windowManager.RootView) { container.RemovePage(previousRootView); } container.AddPage(windowManager.RootView); } if (window.VisualDiagnosticsOverlay != null) { window.VisualDiagnosticsOverlay.Initialize(); } }
public static void MapToolbar(IWindowHandler handler, IWindow view) { if (view is IToolbarElement tb) { ViewHandler.MapToolbar(handler, tb); } }
public void Remove(IWindowHandler window) { if (WindowsCount < 1) { return; } if (window == null || !windowStack.Contains(window)) { return; } Stack <IWindowHandler> tempWins = new Stack <IWindowHandler>();//不受影响的窗口集 while (windowStack.Count > 0) { IWindowHandler topWin = windowStack.Pop(); if (topWin != window) { tempWins.Push(topWin); } TopOrder--; } while (tempWins.Count > 0) { PushWithoutNotify(tempWins.Pop());//重新把不受影响的窗口按新打开的方式回去,使其有新的Sort Order } windowPauseState.Remove(window); }
public static void MapMenuBar(IWindowHandler handler, IWindow view) { if (!OperatingSystem.IsIOSVersionAtLeast(13)) { return; } if (MauiUIApplicationDelegate.Current != null && view is IMenuBarElement mb) { if (MauiUIApplicationDelegate.Current.MenuBuilder == null) { UIMenuSystem .MainSystem .SetNeedsRebuild(); } else { // The handlers that are part of MenuBar // are only relevant while the menu is being built // because you can only build a menu while the // `AppDelegate.BuildMenu` override is running mb.MenuBar?.Handler?.DisconnectHandler(); mb.MenuBar? .ToHandler(handler.MauiContext !)? .DisconnectHandler(); } } }
internal static View?CreateRootViewFromContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var rootManager = handler.MauiContext.GetNavigationRootManager(); rootManager.Connect(window.Content); return(rootManager.RootView); }
public static void MapMenuBar(IWindowHandler handler, IWindow view) { if (view is IMenuBarElement mb) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var windowManager = handler.MauiContext.GetNavigationRootManager(); windowManager.SetMenuBar(mb.MenuBar?.ToPlatform(handler.MauiContext !) as MenuBar); } }
public CheckGoDownHandler(IExclusionCheck exclusionCheck, IReasonHandler reasonHadler, IPlayEventsService eventService, IWindowHandler windowHandler, IPlayerInfoHolder playerHolder) { _exclusionCheck = exclusionCheck; _reasonHandler = reasonHadler; _windowHandler = windowHandler; _playerHolder = playerHolder; _eventService = eventService; }
public MainWindowViewModel(IWindowHandler windowHandler) { Handler = windowHandler; RefreshProcessListCommand = new DelegateCommand(RefreshProcessList); SetOnTopCommand = new DelegateCommand(SetOnTop); SetOffTopCommand = new DelegateCommand(SetOffTop); BringToFrontCommand = new DelegateCommand(BringToFront); UpdateTitleCommand = new DelegateCommand(UpdateTitle); }
public static void MapContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var rootView = CreateRootViewFromContent(handler, window); handler.PlatformView.SetContentView(rootView); if (window.VisualDiagnosticsOverlay != null && rootView is ViewGroup group) { window.VisualDiagnosticsOverlay.Initialize(); } }
public ExperienceHandler(IReasonHandler reasonHandler, IWindowHandler windowHandler, IPlayerInfoHolder playerInfoHolder, IGameInfoHolder gameInfoHolder) { _windowHandler = windowHandler; _playerInfoHolder = playerInfoHolder; _gameInfoHolder = gameInfoHolder; _reasonHandler = reasonHandler; _reasonHandler.WindowHandler = _windowHandler; if (_playerInfoHolder.UniversityPoints == 0) { OpenTestWindow(TestType.EIT); } }
public static void MapContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var nativeContent = window.Content.ToUIViewController(handler.MauiContext); handler.PlatformView.RootViewController = nativeContent; if (window.VisualDiagnosticsOverlay != null) { window.VisualDiagnosticsOverlay.Initialize(); } }
public static void MapContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var platformContent = window.Content.ToContainerView(handler.MauiContext); platformContent.SetAlignment(-1, -1); platformContent.SetWeight(1, 1); platformContent.Show(); handler.MauiContext.GetModalStack().Reset(); handler.MauiContext.GetModalStack().Push(platformContent); if (window.VisualDiagnosticsOverlay != null) { window.VisualDiagnosticsOverlay.Initialize(); } }
public static void MapContent(IWindowHandler handler, IWindow window) { _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class."); var windowManager = handler.MauiContext.GetNavigationRootManager(); windowManager.Connect(handler.VirtualView.Content); var rootPanel = handler.PlatformView.Content as Panel; if (rootPanel == null) { return; } rootPanel.Children.Clear(); rootPanel.Children.Add(windowManager.RootView); if (window.VisualDiagnosticsOverlay != null) { window.VisualDiagnosticsOverlay.Initialize(); } }
public static void MapFlowDirection(IWindowHandler handler, IWindow view) { var WindowHandle = handler.PlatformView.GetWindowHandle(); // Retrieve current extended style var extended_style = PlatformMethods.GetWindowLongPtr(WindowHandle, PlatformMethods.WindowLongFlags.GWL_EXSTYLE); long updated_style; if (view.FlowDirection == FlowDirection.RightToLeft) { updated_style = extended_style | (long)PlatformMethods.ExtendedWindowStyles.WS_EX_LAYOUTRTL; } else { updated_style = extended_style & ~((long)PlatformMethods.ExtendedWindowStyles.WS_EX_LAYOUTRTL); } if (updated_style != extended_style) { PlatformMethods.SetWindowLongPtr(WindowHandle, PlatformMethods.WindowLongFlags.GWL_EXSTYLE, updated_style); } }
public Window(WindowSettings settings, IWindowHandler windowHandler) { NativeWindowSettings nativeSettings = NativeWindowSettings.Default; nativeSettings.Size = new Vector2i(settings.Width, settings.Height); nativeSettings.Title = settings.Title; nativeSettings.WindowState = settings.State; nativeSettings.WindowBorder = settings.Border; nativeSettings.NumberOfSamples = settings.Samples; nativeSettings.Flags = ContextFlags.ForwardCompatible; gameWindow = new GameWindow(GameWindowSettings.Default, nativeSettings); gameWindow.Load += GameWindow_Load; gameWindow.Unload += GameWindow_Unload; gameWindow.Resize += GameWindow_Resize; gameWindow.UpdateFrame += GameWindow_UpdateFrame; gameWindow.RenderFrame += GameWindow_RenderFrame; gameWindow.MouseWheel += GameWindow_MouseWheel; WindowHandler = windowHandler; this.settings = settings; }
private void DelegateBinding(IWindowHandler handler) { if (handler == null) { return; } // 윈도우 닫기 이벤트 핸들러 바인딩. handler.OnCloseEvent += (sender, result) => { DialogResult = result; Close(); }; handler.OpenWindowEvent += (sender, windowName, viewModel) => { var window = Container.Resolve <IWindow>(windowName); window.DataContext = viewModel; window.Owner = this; return(window.ShowDialog()); }; }
public void Push(IWindowHandler window) { PushWithoutNotify(window); OnPushWindow?.Invoke(); }
public static void MapTitle(IWindowHandler handler, IWindow window) => handler.PlatformView?.UpdateTitle(window);
public MasterWindow(IWindowHandler handler) : base(handler) { }
public MyBaseWindow(IWindowHandler handler) { _handler = handler; }
public Scenario(IWindowHandler windowHandler) : base(windowHandler) { }
public void PushToTop(IWindowHandler window) { Remove(window); PushWithoutNotify(window); }
protected Scenario(IWindowHandler windowHandler) { WindowHandler = windowHandler; }
private void PushWithoutNotify(IWindowHandler window) { windowStack.Push(window); window.CanvasToSort.sortingOrder = TopOrder + 1; TopOrder = window.CanvasToSort.sortingOrder; }
public static void MapContent(IWindowHandler handler, IWindow window) { }
public static void MapTitle(IWindowHandler handler, IWindow window) { }
public static void MapRequestDisplayDensity(IWindowHandler handler, IWindow window, object?args) { }