예제 #1
0
        private void _IsEditModeChanged(object sender, bool editMode)
        {
            view_Evo_ViewMode.Visibility = !editMode ? Visibility.Visible : Visibility.Collapsed;
            view_Evo_EditMode.Visibility = editMode ? Visibility.Visible : Visibility.Collapsed;

            if (editMode)
            {
                _Saved = false;

                //

                view_Evo_EditMode.UpdateCurrentTaxonInfo();
                view_Tree.UpdateSubTree();
            }
            else
            {
                Taxon currentTaxon = Common.CurrentTaxon;

                // 退出编辑模式时,应位于具名类群(或顶级类群)
                if (!currentTaxon.IsRoot && currentTaxon.IsAnonymous)
                {
                    Taxon parent = currentTaxon.GetNamedParent();

                    if (parent is null)
                    {
                        parent = currentTaxon.Root;
                    }

                    Common.CurrentTaxon = parent;
                }
                else
                {
                    view_Evo_ViewMode.UpdateCurrentTaxonInfo();
                    view_Tree.UpdateSubTree();
                }
            }
        }