/// <summary> /// Restores the state of the branch /// </summary> /// <typeparam name="TTabModel">The type of tab model</typeparam> /// <typeparam name="TTabViewModel">The type of tab view model to be displayed in the app.</typeparam> /// <param name="tabablzControl">The control in which to restore the items</param> /// <param name="branchState">The state of the branch to be restored</param> /// <param name="viewModelFactory">The function that creates the view model based on a model</param> private static void RestoreBranchState <TTabModel, TTabViewModel>(TabablzControl tabablzControl, BranchState <TTabModel> branchState, Func <TTabModel, TTabViewModel> viewModelFactory) { var branchResult = Layout.Branch(tabablzControl, CopyTabablzControl(tabablzControl), branchState.Orientation, false, branchState.Ratio); RestoreBranchItemState(tabablzControl, branchState.FirstChild, viewModelFactory); RestoreBranchItemState(branchResult.TabablzControl, branchState.SecondChild, viewModelFactory); }
/// <summary> /// The generic constructor, used by the Json deserializer /// </summary> /// <param name="itemAsBranch">If this item is a branch, this parameter must contain the branch state (<c>null</c> otherwise)</param> /// <param name="itemAsTabSet">If this item is a tab set, this parameter must contain the tab set state (<c>null</c> otherwise)</param> public BranchItemState(BranchState <TTabItem> itemAsBranch, TabSetState <TTabItem> itemAsTabSet) { this.ItemAsBranch = itemAsBranch; this.ItemAsTabSet = itemAsTabSet; }