//if child was added void element_ChildAdded(object sender, ChildAddedEventArgs e) { var parent = sender as SvgElement; if (e.NewChild is SvgVisualElement) { var newChild = e.NewChild; if ((!newChild.ID.StartsWith(parent.ID + "_") || parent is SvgDocument) && !(parent is SvgDefinitionList)) { newChild.ApplyRecursive(elem => { var oldID = elem.ID.Substring(elem.ID.LastIndexOf("_") + 1); elem.SetAndForceUniqueID(elem.Parent.ID + "_" + oldID); elem.RegisterEvents(FCaller); }); } else { newChild.RegisterEvents(FCaller); } } //add to remote context if (e.NewChild.OwnerDocument != null) { if (e.BeforeSibling == null) { RemoteContext.AddElement(e.NewChild); } else { RemoteContext.InsertElementBefore(e.NewChild, e.BeforeSibling); } } }
// From Container Base class /// <summary> /// Adds a child view to this view. /// </summary> /// <seealso cref="Container.Add" /> /// <since_tizen> 4 </since_tizen> public override void Add(View child) { bool hasLayout = (layout != null); if (null == child) { Tizen.Log.Fatal("NUI", "Child is null"); return; } Container oldParent = child.GetParent(); if (oldParent != this) { // If child already has a parent then re-parent child if (oldParent != null) { if (child.Layout != null) { child.Layout.SetReplaceFlag(); } oldParent.Remove(child); } child.InternalParent = this; LayoutCount += child.LayoutCount; Interop.Actor.Add(SwigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } Children.Add(child); if (ChildAdded != null) { ChildAddedEventArgs e = new ChildAddedEventArgs { Added = child }; ChildAdded(this, e); } AddChildBindableObject(child); } }
void OnChildAddedToRepository(object sender, ChildAddedEventArgs e) { var viewModel = new ChildViewModel(e.NewChild, _childRepository); this.AllChilds.Add(viewModel); }
//if child was added void element_ChildAdded(object sender, ChildAddedEventArgs e) { var parent = sender as SvgElement; if(e.NewChild is SvgVisualElement) { var newChild = e.NewChild; if((!newChild.ID.StartsWith(parent.ID + "_") || parent is SvgDocument) && !(parent is SvgDefinitionList)) { newChild.ApplyRecursive( elem => { var oldID = elem.ID.Substring(elem.ID.LastIndexOf("_") + 1); elem.SetAndForceUniqueID(elem.Parent.ID + "_" + oldID); elem.RegisterEvents(FCaller); }); } else { newChild.RegisterEvents(FCaller); } } //add to remote context if(e.NewChild.OwnerDocument != null) { if(e.BeforeSibling == null) { RemoteContext.AddElement(e.NewChild); } else { RemoteContext.InsertElementBefore(e.NewChild, e.BeforeSibling); } } }
public override void CallEvent(FirebaseException firebaseException) { var childAddedEventArgs = new ChildAddedEventArgs(firebaseException); @event(childAddedEventArgs); }
public override void CallEvent(Snapshot snapshot) { var childAddedEventArgs = new ChildAddedEventArgs(snapshot); @event(childAddedEventArgs); }