/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { ClearVisualChildren(); Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); if (!Panel.IsSet(KeyboardNavigation.DirectionalNavigationProperty)) { KeyboardNavigation.SetDirectionalNavigation( (InputElement)Panel, KeyboardNavigationMode.Contained); } AddVisualChild(Panel); var logicalHost = this.FindReparentingHost(); if (logicalHost != null) { ((IReparentingControl)Panel).ReparentLogicalChildren( logicalHost, logicalHost.LogicalChildren); } KeyboardNavigation.SetTabNavigation( (InputElement)Panel, KeyboardNavigation.GetTabNavigation(this)); _createdPanel = true; CreateItemsAndListenForChanges(Items); }
/// <summary> /// Creates the <see cref="Panel"/>. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; var task = MoveToPage(-1, SelectedIndex); }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; if (!IsHosted && _itemsSubscription == null && Items is INotifyCollectionChanged incc) { _itemsSubscription = incc.WeakSubscribe(ItemsCollectionChanged); } PanelCreated(Panel); }
/// <summary> /// Creates the <see cref="Panel"/>. /// </summary> private void CreatePanel() { var logicalHost = this.FindReparentingHost(); ClearVisualChildren(); Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); AddVisualChild(Panel); if (logicalHost != null) { ((IReparentingControl)Panel).ReparentLogicalChildren( logicalHost, logicalHost.LogicalChildren); } _createdPanel = true; var task = MoveToPage(-1, SelectedIndex); }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> protected virtual void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); _createdPanel = true; INotifyCollectionChanged incc = Items as INotifyCollectionChanged; if (incc != null) { incc.CollectionChanged += ItemsCollectionChanged; } ItemsChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); }
/// <summary> /// Creates the <see cref="Panel"/> when <see cref="ApplyTemplate"/> is called for the first /// time. /// </summary> private void CreatePanel() { Panel = ItemsPanel.Build(); Panel.SetValue(TemplatedParentProperty, TemplatedParent); if (!Panel.IsSet(KeyboardNavigation.DirectionalNavigationProperty)) { KeyboardNavigation.SetDirectionalNavigation( (InputElement)Panel, KeyboardNavigationMode.Contained); } LogicalChildren.Clear(); VisualChildren.Clear(); LogicalChildren.Add(Panel); VisualChildren.Add(Panel); KeyboardNavigation.SetTabNavigation( (InputElement)Panel, KeyboardNavigation.GetTabNavigation(this)); _createdPanel = true; CreateItemsAndListenForChanges(Items); }