public IList <IControlWithState> GetNotLoadedChildren(IControlWithState parent) { IList <IControlWithState> controls = null; this.NotLoadedChildrens.TryGetValue(parent, out controls); return(controls); }
public IControlWithState GetNotLoadedParent(IControlWithState control) { IControlWithState result = null; this.NotLoadedControls.TryGetValue(control, out result); return(result); }
//Removes the control from the list public void RemoveNotLoadedChildren(IControlWithState parent, IControlWithState control) { IList <IControlWithState> controls = null; this.NotLoadedChildrens.TryGetValue(parent, out controls); controls.Remove(control); if (controls.Count == 0) { this.NotLoadedChildrens.Remove(parent); } }
/// <summary> /// Stores the not visible controls that were not loaded during the LifeCycleStartup process. /// </summary> /// <param name="control"></param> public void RegisterNotLoadedControl(IControlWithState control, IControlWithState parent) { if (this.NotLoadedControls.ContainsKey(control)) { this.NotLoadedControls[control] = parent; } else { this.NotLoadedControls.Add(control, parent); } }
//Adds or updartes the list of child controls that are not yet loaded. public void RegisterNotLoadedChildren(IControlWithState parent, IControlWithState control) { IList <IControlWithState> controls = null; this.NotLoadedChildrens.TryGetValue(parent, out controls); if (controls == null) { controls = StaticContainer.Instance.Resolve <IList <IControlWithState> >(); controls.Add(control); this.NotLoadedChildrens.Add(parent, controls); } else { controls.Add(control); } }
/// <summary> /// Handles the startup events execution for a control. /// </summary> /// <param name="parent"></param> /// <summary> /// Handles the startup events execution for a control. /// </summary> /// <param name="parent"></param> public virtual void LifeCycleStartup(IControlWithState parent = null) { if (this.Loaded || !this.Visible || (parent != null && !parent.Loaded && !parent.Visible)) { //The control is either already loaded or not ready to be loaded yet. return; } this.Loaded = true; //The Events chain is executed for a form startup CallHandleCreatedEvent(); CallBindingContextChanged(); CallLoadEvents(); CallVisibleChangedEvents(); }
/// <summary> /// Handles the startup events execution for a form. /// </summary> /// <param name="parent"></param> /// <param name="parent"></param> public virtual void LifeCycleStartup(IControlWithState parent = null) { if (this.ViewModel.Loaded) { //If the from is already loaded the activated event is the only one that is called. CallActivated(); return; } this.ViewModel.Loaded = true; //The Events chain is executed for a form startup CallHandleCreatedEvents(); CallBindingContextChangedEvents(); CallLoadEvents(); CallVisibleChangedEvents(); CallActivated(); }
/// <summary> /// Removes a control from the pending to load dictionary /// The control has been loaded or its parent has been disposed. /// </summary> /// <param name="control"></param> public void RemoveNotLoadedControl(IControlWithState control) { this.NotLoadedControls.Remove(control); }