public void ShowRightContent(RightContent content, bool foldLeft = true) { if (content == RightContent.None) { RightContentControl = null; ShowLeftMenu(true); } else if (content == RightContent.Editor) { RightContentControl.Content = EditorPanel; } else if (content == RightContent.Option) { OptionPanel.UpdatePanel(); RightContentControl.Content = OptionPanel; OptionButtonPopup.IsOpen = false; if (foldLeft) { ShowLeftMenu(false); } } else if (content == RightContent.PairList) { if (TransformListFiles.SelectedItem == null) { return; } // 在此处检查文件是否存在 string path = @"pair folder\" + TransformListFiles.SelectedItem.ToString() + ".txt"; if (!File.Exists(path)) { MessageBox.Show("找不到文件:" + path); return; } RightContentControl.Content = PairListPanel; PairListPanel.LoadFile(path); if (foldLeft) { ShowLeftMenu(false); } } CurrentRightContent = content; }