コード例 #1
0
ファイル: StartupViewModel.cs プロジェクト: Kilowatt-W/Kamban
        public void Initialize(ViewRequest viewRequest)
        {
            if (initialized)
            {
                return;
            }

            shell.AddGlobalCommand("File", "Create", nameof(NewFileCommand), this)
            .SetHotKey(ModifierKeys.Control, Key.N);

            shell.AddGlobalCommand("File", "Open", nameof(OpenFileCommand), this)
            .SetHotKey(ModifierKeys.Control, Key.O);

            shell.AddGlobalCommand("File", "Import", nameof(ImportCommand), this)
            .SetHotKey(ModifierKeys.Control, Key.I);

            shell.AddGlobalCommand("File", "Export", nameof(ExportCommand), this)
            .SetHotKey(ModifierKeys.Control, Key.U);

            shell.AddGlobalCommand("File", "Print", nameof(PrintCommand), this)
            .SetHotKey(ModifierKeys.Control, Key.P);

            shell.AddGlobalCommand("File", "Show Startup", nameof(ShowStartupCommand), this, true);

            shell.AddGlobalCommand("File", "Exit", nameof(ExitCommand), this);

            initialized = true;

            Observable.FromAsync(_ => appConfig.LoadOnlineContentAsync())
            .Subscribe(_ =>
            {
                PublicBoards = appConfig.PublicBoards;
            });
        }