void UnRegisterFromParentContainer() { if (parentContainer != null) { parentContainer.children.Remove(this); this.parentContainer = null; } }
public UIElement GetContainer(ModelItem modelItem, ICompositeView sourceContainer) { FrameworkElement view = null; if (IsVirtualiztionEnabled) { view = new VirtualizingContainer(this, modelItem, sourceContainer); view.Loaded += this.OnViewLoaded; view.Unloaded += this.OnViewUnloaded; } else { view = this.GetViewElement(modelItem, sourceContainer); } return(view); }
void RegisterWithParentContainer() { DependencyObject parent = VisualTreeHelper.GetParent(this); while (null != parent && !(parent is VirtualizingContainer)) { parent = VisualTreeHelper.GetParent(parent); } this.parentContainer = parent as VirtualizingContainer; if (parentContainer != null) { if (!parentContainer.children.Contains(this)) { parentContainer.children.Add(this); } } }
public UIElement GetContainer(ModelItem modelItem, ICompositeView sourceContainer) { FrameworkElement view = null; if (IsVirtualiztionEnabled) { view = new VirtualizingContainer(this, modelItem, sourceContainer); view.Loaded += this.OnViewLoaded; view.Unloaded += this.OnViewUnloaded; } else { view = this.GetViewElement(modelItem, sourceContainer); } return view; }