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(); }
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(); } }