silverlight和wpf中暴露 给子类override
protected virtual void OnSelectionChanged(SelectionChangedEventArgs args) { }
1 public TestTabControl() 2 { 3 KeyEventHandler handler = null; 4 SelectionChangedEventHandler handler2 = null; 5 this._updateIndex = true; 6 this.SelectedIndex = -1; 7 8 9 if (handler == null) 10 { 11 handler = (sender, e) => this.OnKeyDown(e); 12 } 13 base.KeyDown += handler; 14 15 //make child can override SelectionChanged event 16 if (handler2 == null) 17 { 18 handler2 = (sender, e) => this.OnSelectionChanged(e); 19 } 20 this.SelectionChanged += handler2; 21 22 23 base.IsEnabledChanged += new DependencyPropertyChangedEventHandler(this.OnIsEnabledChanged); 24 base.DefaultStyleKey = typeof(TestTabControl); 25 26 }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步