private void DrawRightPane(BufferContainer buffer) { int xOffset = ((Right - Left) / 2); WriteAt(buffer, xOffset, 0, $"{RightPane.ToString()}"); DrawItems(buffer, xOffset, 2, GetItems(RightPane), RightPane, LeftPane, RightHasFocus); }
public void Initialize() { LeftPane = (IPaneViewModel)Container.Resolve(GetStoredPaneType(_userSettings.LeftPaneType)); var leftParam = _userSettings.LeftPaneFileListPaneSettings; LeftPane.LoadDataAsync(LoadCommand.Load, new LoadDataAsyncParameters(leftParam), PaneLoaded); LeftPane.SetActive(); RightPane = (IPaneViewModel)Container.Resolve(GetStoredPaneType(_userSettings.RightPaneType)); var rightParam = _userSettings.RightPaneFileListPaneSettings; RightPane.LoadDataAsync(LoadCommand.Load, new LoadDataAsyncParameters(rightParam), PaneLoaded); }
private void OnOpenNestedPane(OpenNestedPaneEventArgs args) { if (LeftPane == args.Opener) { _leftPaneStack.Push(LeftPane); LeftPane = args.Openee; LeftPane.SetActive(); } else if (RightPane == args.Opener) { _rightPaneStack.Push(RightPane); RightPane = args.Openee; RightPane.SetActive(); } }
/// <summary> /// Text /// </summary> /// <returns>text</returns> public override string ToString() { if (SingleChild != null) { return("DC: " + SingleChild.Text); } if (LeftPane != null) { return("DC[" + LeftPane.ToString() + " | " + RightPane.ToString() + "]"); } if (TopPane != null) { return("DC[" + TopPane.ToString() + " | " + BottomPane.ToString() + "]"); } return("DC<ModeEmpty>"); }
private void OnCloseNestedPane(CloseNestedPaneEventArgs args) { if (LeftPane == args.Pane) { var settings = LeftPane.Settings; LeftPane.Dispose(); LeftPane = _leftPaneStack.Pop(); LeftPane.LoadDataAsync(LoadCommand.Restore, new LoadDataAsyncParameters(settings, args.Payload)); LeftPane.SetActive(); } else if (RightPane == args.Pane) { var settings = RightPane.Settings; RightPane.Dispose(); RightPane = _rightPaneStack.Pop(); RightPane.LoadDataAsync(LoadCommand.Restore, new LoadDataAsyncParameters(settings, args.Payload)); RightPane.SetActive(); } }
//Animations:动画 //两侧侧栏:模糊特效 private void SplitViewCollapsed() { LeftPane.Saturation(value: 0, duration: 600, delay: 0).StartAsync(); RightPane.Saturation(value: 0, duration: 600, delay: 0).StartAsync(); LeftGrid.Visibility = Visibility.Visible; RightGrid.Visibility = Visibility.Visible; //侧栏 if (nwe == WidthEnum.PhoneNarrow || nwe == WidthEnum.PhoneStrath)//如果手机竖屏或手机横屏 { LeftBorder.Visibility = Visibility.Collapsed; RightBorder.Visibility = Visibility.Collapsed; } //顶栏动画 MainTitleBar.Visibility = Visibility.Collapsed; SecondTitleBar.Visibility = Visibility.Visible; }
public override void Dispose() { object data = null; FileListPaneSettings settings; IPaneViewModel left; do { settings = LeftPane.Settings; data = LeftPane.Close(data); left = LeftPane; LeftPane = _leftPaneStack.Count > 0 ? _leftPaneStack.Pop() : null; if (LeftPane != null) { LeftPane.LoadDataAsync(LoadCommand.Restore, new LoadDataAsyncParameters(settings)); } }while (LeftPane != null); _userSettings.LeftPaneType = left.GetType().FullName; _userSettings.LeftPaneFileListPaneSettings = left.Settings; data = null; IPaneViewModel right; do { settings = RightPane.Settings; data = RightPane.Close(data); right = RightPane; RightPane = _rightPaneStack.Count > 0 ? _rightPaneStack.Pop() : null; if (RightPane != null) { RightPane.LoadDataAsync(LoadCommand.Restore, new LoadDataAsyncParameters(settings)); } }while (RightPane != null); _userSettings.RightPaneType = right.GetType().FullName; _userSettings.RightPaneFileListPaneSettings = right.Settings; base.Dispose(); }
private void OnRefreshPanes(RefreshPanesEventArgs e) { LeftPane.Refresh(false); RightPane.Refresh(false); }