public ControlPopUpRowItemModel(string title, PackIconKind kind, TitleBarButtons button, GeneralRoutingEnum route = GeneralRoutingEnum.None) { Title = title; Kind = kind; Button = button; Route = route; }
public RootDialogWrapper(TitleBarButtons button) { InitializeComponent(); Routing.RoutingManager.SwitchDialogContent(this.DialogFrame, button); this.DataContext = new RootDialogWrapperViewModel(button); }
public static void SwitchDialogContent(Frame contentFrame, TitleBarButtons titleBarButton) { var navigationService = contentFrame.NavigationService; string uri = null; object routeData = null; switch (titleBarButton) { case TitleBarButtons.Info: { uri = "Pages/Dialog/InfoDialogPage.xaml"; } break; case TitleBarButtons.Settings: { uri = "Pages/Dialog/SettingsDialogPage.xaml"; } break; case TitleBarButtons.ViewAccount: { uri = "Pages/Dialog/AccountDialogPage.xaml"; } break; } if (!string.IsNullOrEmpty(uri)) { navigationService.Navigate(new Uri(uri, UriKind.Relative), routeData); } }
public static void DisableTitleBarButtons(IntPtr handle, TitleBarButtons buttons) { if (handle == IntPtr.Zero) { throw new InvalidOperationException("The window has not yet been completely initialized"); } var dwNewLongTitleBarButtons = 0; if (buttons.HasFlag(TitleBarButtons.Minimaze)) { dwNewLongTitleBarButtons += WS_MINIMIZEBOX; } if (buttons.HasFlag(TitleBarButtons.Maximaze)) { dwNewLongTitleBarButtons += WS_MAXIMIZEBOX; } SetWindowLong(handle, GWL_STYLE, GetWindowLong(handle, GWL_STYLE) & ~dwNewLongTitleBarButtons); }
public async Task ClickHandlerAsync(TitleBarButtons button) { Action closingCallBack = null; switch (button) { case TitleBarButtons.SourceRepository: { mySourceRepositoryClick(); } break; case TitleBarButtons.LogOut: { //LogOut Command } break; case TitleBarButtons.Settings: { closingCallBack = RoutingManager.ClearSettingDialogContent; } goto default; default: { await DialogHost.Show(new RootDialogWrapper(button), "RootDialog", new DialogClosingEventHandler((object sender, DialogClosingEventArgs args) => { if (closingCallBack != null) { closingCallBack(); } })).ConfigureAwait(true); } break; } }
public RootDialogWrapperViewModel(TitleBarButtons _buttonCaller) { buttonCaller = _buttonCaller; }
public static void DisableTitleBarButtons(Window window, TitleBarButtons buttons) { var windowHelper = new WindowInteropHelper(window); DisableTitleBarButtons(windowHelper.Handle, buttons); }