public MainPage(IServiceProvider provider , ILogger <MainPage> logger, DocumentViewModel viewModel , QuickPadCommands command, IVisualThemeSelector vts) { VtSelector = vts; Logger = logger; Commands = command; Clipboard.ContentChanged += Clipboard_ContentChanged; GotFocus += OnGotFocus; App.Controller.AddView(this); Initialize?.Invoke(this, Commands); this.InitializeComponent(); _initialized = true; DataContext = ViewModel = viewModel; Loaded += OnLoaded; Unloaded += OnUnloaded; //extent app in to the title bar CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var tBar = ApplicationView.GetForCurrentView().TitleBar; tBar.ButtonBackgroundColor = Colors.Transparent; tBar.ButtonInactiveBackgroundColor = Colors.Transparent; ViewModel.ExitApplication = ExitApp; ViewModel.PropertyChanged += ViewModel_PropertyChanged; Settings.PropertyChanged += Settings_PropertyChanged; ViewModel.SetScale += ViewModel_SetScale; SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest; var currentView = SystemNavigationManager.GetForCurrentView(); currentView.BackRequested += CurrentView_BackRequested; commandBar.SetFontName += CommandBarOnSetFontName; commandBar.SetFontSize += CommandBarOnSetFontSize; if (!SystemInformation.IsAppUpdated) { return; } //show the welcome dialog var dialog = provider.GetService <WelcomeDialog>(); _ = dialog.ShowAsync(); ClearJumplist(); }
public MainPage(IServiceProvider provider , ILogger <MainPage> logger , DocumentViewModel <StorageFile, IRandomAccessStream> viewModel , QuickPadCommands <StorageFile, IRandomAccessStream> command , IVisualThemeSelector vts) { Provider = provider; VtSelector = vts; Logger = logger; Commands = command; Clipboard.ContentChanged += Clipboard_ContentChanged; GotFocus += OnGotFocus; Initialize?.Invoke(this, Commands, App); this.InitializeComponent(); var rtfOptions = provider.GetService <RtfDocumentOptions>(); rtfOptions.Document = RichEditBox.Document; rtfOptions.Logger = provider.GetService <ILogger <RtfDocument> >(); rtfOptions.ViewModel = viewModel; var textOptions = provider.GetService <TextDocumentOptions>(); textOptions.Document = TextBox; textOptions.Logger = provider.GetService <ILogger <TextDocument> >(); textOptions.ViewModel = viewModel; CreateNewDocument?.Invoke(this); DataContext = ViewModel = viewModel; Loaded += OnLoaded; Unloaded += OnUnloaded; //extent app in to the title bar CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var tBar = ApplicationView.GetForCurrentView().TitleBar; tBar.ButtonBackgroundColor = Colors.Transparent; tBar.ButtonInactiveBackgroundColor = Colors.Transparent; Settings.ExitApplication = ExitApp; ViewModel.PropertyChanged += ViewModel_PropertyChanged; Settings.PropertyChanged += Settings_PropertyChanged; ViewModel.SetScale += ViewModel_SetScale; SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += this.OnCloseRequest; var currentView = SystemNavigationManager.GetForCurrentView(); currentView.BackRequested += CurrentView_BackRequested; commandBar.SetFontName += CommandBarOnSetFontName; commandBar.SetFontSize += CommandBarOnSetFontSize; if (SystemInformation.TotalLaunchCount == 3) { var(success, dialog) = provider.GetService <DialogManager>().RequestDialog <AskForReviewDialog>(); if (!success) { return; } _ = dialog.ShowAsync(); } _initialized = true; }
public DefaultTextForegroundColor(IVisualThemeSelector visualThemeSelector) { _visualThemeSelector = visualThemeSelector; }