optimized demo start-up speed
This commit is contained in:
1 parent
b57e6e8961
commit
aa745e32b1
14 files changed
+116
-69
No files matched your search
@@ -1,25 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Input;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
using HandyControlDemo.UserControl;
|
||||
using HandyControlDemo.ViewModel;
|
||||
|
||||
namespace HandyControlDemo
|
||||
{
|
||||
public partial class MainWindow
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public MainWindow() => InitializeComponent();
|
||||
|
||||
protected override void OnInitialized(EventArgs e)
|
||||
protected override void OnContentRendered(EventArgs e)
|
||||
{
|
||||
base.OnInitialized(e);
|
||||
base.OnContentRendered(e);
|
||||
|
||||
DataContext = ViewModelLocator.Instance.Main;
|
||||
NonClientAreaContent = new NoUserContent();
|
||||
ControlMain.Content = new MainWindowContent();
|
||||
|
||||
GlobalShortcut.Init(new List<KeyBinding>
|
||||
{
|
||||
new KeyBinding(ViewModelLocator.Instance.Main.GlobalShortcutInfoCmd, Key.I, ModifierKeys.Control | ModifierKeys.Alt),
|
||||
new KeyBinding(ViewModelLocator.Instance.Main.GlobalShortcutWarningCmd, Key.E, ModifierKeys.Control | ModifierKeys.Alt)
|
||||
});
|
||||
|
||||
Dialog.SetToken(this, MessageToken.MainWindow);
|
||||
WindowAttach.SetIgnoreAltF4(this, true);
|
||||
|
||||
ConfigHelper.Instance.SetSystemVersionInfo(CommonHelper.GetSystemVersionInfo());
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.PracticalDemo}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user