public MainViewModel()
        {
            ExplorerViewModel = new ExplorerViewModel();
            ExplorerViewModel.SelectedItemChanged += (sender, item) => {
                FullPath = item.FullPath;
                VirtualPath = item.VirtualPath;
                Files = item.EntriesAsync;
            };

            RefreshCommand = CreateCommand(
                exe => ExplorerViewModel = new ExplorerViewModel(),
                can => { return true; });
            LinkCommand = CreateCommand(
                exe => ExplorerViewModel.VirtualPath = LinkText,
                can => { return true; });
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainViewModel()
        {
            if (IsDesign) return;

            ContentViewModel = new ContentViewModel();
            ContentViewModel.Logger += (message) => {
                LogViewModel.Logger(message);
            };

            ContentViewModel.DirectoryOpened += (sender, vpath) => {
                ExplorerViewModel.VirtualPath = vpath;
            };

            ExplorerViewModel = new ExplorerViewModel();
            ExplorerViewModel.SelectedItemChanged += (sender, item) => {
                ContentViewModel.LoadContents(item);
            };
            ExplorerViewModel.VirtualPath = Properties.Settings.Default.DefaultPath;

            LogViewModel = new LogViewModel();
            LogViewModel.Logger("Start Application");

            // 再表示
            RefreshCommand = CreateCommand(
                exe => {
                    ExplorerViewModel.Refresh();
                    ContentViewModel.LoadContents(ContentViewModel.CurrentDirectory);
                },
                can => { return true; });

            // 終了
            ExitCommand = CreateCommand(
                exe => Application.Current.Shutdown(),
                can => { return true; });

            // ショートカット
            ShortcutCommand = CreateCommand(
                exe => {
                    StringBuilder message = new StringBuilder();
                    message.AppendLine("F5 : 表示更新(ディレクトリ)");
                    message.AppendLine("CTRL + ホイール : イメージの拡大/縮小");
                    MessageBox.Show(message.ToString(), "HELP - Shortcut");
                },
                can => { return true; });

            // 設定確認
            ShowConfigCommand = CreateCommand(
                exe => {
                    StringBuilder config = new StringBuilder();
                    config.AppendLine("ImageHeight : " + Settings.Default.ImageHeight.ToString());
                    config.AppendLine("TooltipWidth : " + Settings.Default.TooltipWidth.ToString());
                    config.AppendLine("IsHorizontalScroll : " + Settings.Default.IsHorizontalScroll.ToString());
                    config.AppendLine("DefaultPath : " + Settings.Default.DefaultPath);
                    MessageBox.Show(config.ToString(), "HELP - Show Config");
                },
                can => { return true; });

            // 設定リセット
            ResetConfigCommand = CreateCommand(
                exe => {
                    if (MessageBox.Show("設定をリセットします。", "HELP - Reset Config", MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
                        Settings.Default.Reset();
                        MessageBox.Show("Config Reset");
                    }
                },
                can => { return true; });

            // キャッシュリセット
            ResetCacheCommand = CreateCommand(
                exe => {
                    if (MessageBox.Show("キャッシュをリセットします。", "HELP - Reset Cache", MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
                        DirectoryInfo dir = new DirectoryInfo(Path.GetTempPath() + Settings.Default.ThumbnailsPath);
                        if (dir.Exists) {
                            try {
                                dir.Delete(true);
                                dir.Create();
                            } catch (IOException) { }
                            MessageBox.Show("Cache Reset");
                        } else {
                            MessageBox.Show("Cache ディレクトリが空です。");
                        }
                    }
                },
                can => { return true; });

            // タグ登録
            TagRegistCommand = CreateCommand(
                exe => {
                    TagRegisterWindow window = new TagRegisterWindow();
                    window.DataContext = new TagRegisterViewModel(ContentViewModel.FileContents);
                    window.Show();
                },
                can => { return ContentViewModel.FileContents != null; });

            // エンコード結果比較
            VideoDiffCommand = CreateCommand(
                exe => { new VideoDiffWindow().Show(); },
                can => { return true; });

            // サブディレクトリの検索
            SearchAllDirectoryCommand = CreateCommand(
                exe => ContentViewModel.LoadContents(
                    ContentViewModel.CurrentDirectory, SearchOption.AllDirectories),
                can => { return ContentViewModel.CurrentDirectory != null; });
        }