Пример #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            var edit = this.GetTemplateChild("edit") as ButtonBase;
            if (edit != null)
            {
                edit.Click += (s, e) =>
                    {
                        var branchEdit = new BranchEdit();
                        branchEdit.DataContext = this.Branch;
                        branchEdit.Show();
                    };
            }

            this.titlePanel = this.GetTemplateChild("titlePanel") as Border;

            if (this.Branch.ParentBranch != null)
                this.BindDragEvent();
        }
Пример #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            var edit = this.GetTemplateChild("edit") as ButtonBase;

            if (edit != null)
            {
                edit.Click += (s, e) =>
                {
                    var branchEdit = new BranchEdit();
                    branchEdit.DataContext = this.Branch;
                    branchEdit.Show();
                };
            }

            this.titlePanel = this.GetTemplateChild("titlePanel") as Border;

            if (this.Branch.ParentBranch != null)
            {
                this.BindDragEvent();
            }
        }