/// <summary> /// 触发 ContentChanging事件 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void RaiseContentChanged(object sender, ContentChangedEventArgs args) { if (ContentChanged != null) { ContentChanged(sender, args); } }
/// <summary> /// 触发内容已经改变事件 /// </summary> /// <param name="sender">参数</param> /// <param name="args">参数</param> public virtual void OnContentChanged(ContentChangedEventArgs args) { if (this.Events != null && this.Events.HasContentChanged) { this.Events.RaiseContentChanged(this, args); } //if (this.OwnerDocument != null) //{ // // 触发文档全局的内容修改后事件 // this.OwnerDocument.OnGlobalContentChanged(this, args); //} }
/// <summary> /// 以冒泡方式出发文档容器元素的OnContentChanged事件 /// </summary> /// <param name="args">事件参数</param> public void RaiseBubbleOnContentChanged(ContentChangedEventArgs args) { DomContainerElement parent = this; while (parent != null) { parent.OnContentChanged(args); if (args.CancelBubble) { break; } parent = parent.Parent; } }