protected void UpdateUI() { RadPageViewPage currentSelected = this.SelectedPage; if (this.viewElement != null) { this.viewElement.Dispose(); } this.viewElement = this.CreateUI(); this.viewElement.Owner = this; this.SuspendEvents(); foreach (RadPageViewPage page in this.pages) { this.viewElement.OnPageAdded(new RadPageViewEventArgs(page)); } this.RootElement.Children.Add(this.viewElement); if (currentSelected != null) { this.SelectedPage = currentSelected; } this.ResumeEvents(); }
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args) { base.OnPropertyChanging(args); if (args.Property != RadElement.VisibilityProperty || this.tabItems.Count <= 0) { return; } RadPageViewElement owner = (this.tabItems[0] as RadPageViewItem).Owner; if (owner == null) { throw new NullReferenceException(string.Format("{0} has no parent TabStrip", (object)this.tabItems[0].ToString())); } for (int index = 0; index < this.tabItems.Count; ++index) { (this.tabItems[index] as RadPageViewItem).Visibility = (ElementVisibility)args.NewValue; } if (this.TabItems.Contains((RadItem)(owner.SelectedItem as RibbonTab))) { foreach (RibbonTab ribbonTab in (IEnumerable <RadPageViewItem>)owner.Items) { if (!this.TabItems.Contains((RadItem)ribbonTab)) { owner.SelectedItem = (RadPageViewItem)ribbonTab; break; } } } owner.InvalidateMeasure(); owner.InvalidateArrange(); owner.UpdateLayout(); }
protected override void DisposeManagedResources() { if (this.pageViewElement != null) { this.pageViewElement = (RadPageViewElement)null; } base.DisposeManagedResources(); }
protected override void DisposeManagedResources() { if (this.page != null) { this.Detach(); } this.owner = (RadPageViewElement)null; base.DisposeManagedResources(); }
public RadRibbonBarCommandTabCollection(RadElement owner) { RadPageViewStripElement viewStripElement = owner as RadPageViewStripElement; if (owner != null) { this.pageViewElement = (RadPageViewElement)viewStripElement; this.Owner = (RadElement)((RadPageViewStripElement)this.pageViewElement).ItemContainer; } else { this.Owner = owner; } }
private void AssureTabAdded() { if (this.ParentCollection == null || this.ParentCollection.Owner == null) { return; } RadPageViewElement owner = (RadPageViewElement)this.ParentCollection.Owner; int index = this.ParentCollection.IndexOf((RadItem)this); if (index >= 0) { owner.RemoveItem((RadPageViewItem)this); } owner.InsertItem(index, (RadPageViewItem)this); }
public GridDetailViewCellElement(GridViewColumn column, GridRowElement row) : base(column, row) { if (this.ViewTemplate.Templates.Count > 1 || row.ViewTemplate.ShowChildViewCaptions) { IRadPageViewProvider pageViewProvider = this.CreatePageViewProvider(); this.pageViewElement = this.CreatePageViewElement(pageViewProvider); this.UpdateTabsPosition(); this.UpdatePageViewItems(pageViewProvider); } else { this.Children.Add((RadElement)this.CreateChildTableElement()); } }
protected override void OnBubbleEvent(RadElement sender, RoutedEventArgs args) { if (sender == this && args.RoutedEvent == RadElement.MouseClickedEvent && this.tabItems.Count > 0) { RadPageViewElement owner = (this.tabItems[0] as RadPageViewItem).Owner; if (owner == null) { throw new NullReferenceException(string.Format("{0} has no parent TabStrip", (object)this.tabItems[0].ToString())); } if (owner.SelectedItem != this.tabItems[0]) { owner.SetSelectedItem((RadPageViewItem)this.tabItems[0]); } } base.OnBubbleEvent(sender, args); }
protected virtual RadPageViewElement CreatePageViewElement( IRadPageViewProvider pageViewProvider) { RadPageViewElement pageViewElement = pageViewProvider.CreatePageViewElement((object)this); pageViewElement.StretchVertically = false; pageViewElement.ContentArea.StretchVertically = false; RadPageViewExplorerBarElement explorerBarElement = pageViewElement as RadPageViewExplorerBarElement; if (explorerBarElement != null) { explorerBarElement.ExpandedChanged += new EventHandler <RadPageViewExpandedChangedEventArgs>(this.explorerBarElement_ExpandedChanged); } pageViewElement.UpdateSelectedItemContent = false; return(pageViewElement); }
private void AssureTabAdded() { if (this.ParentCollection == null || this.ParentCollection.Owner == null || !(this.ParentCollection.Owner is RadTabStripElement)) { return; } RadPageViewElement tabStrip = (RadPageViewElement)this.ParentCollection.Owner; int index = this.ParentCollection.IndexOf(this); if (index >= 0) { tabStrip.RemoveItem(this); } tabStrip.InsertItem(index, this); }
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args) { base.OnPropertyChanging(args); if (args.Property == RadItem.VisibilityProperty) { if (this.tabItems.Count > 0) { RadPageViewElement tabStrip = (this.tabItems[0] as RadPageViewItem).Owner; if (tabStrip == null) { throw new NullReferenceException( string.Format("{0} has no parent TabStrip", this.tabItems[0].ToString())); } for (int i = 0; i < this.tabItems.Count; i++) { RadPageViewItem currentTab = this.tabItems[i] as RadPageViewItem; currentTab.Visibility = (ElementVisibility)args.NewValue; } if (this.TabItems.Contains(tabStrip.SelectedItem as RibbonTab)) { foreach (RibbonTab tab in tabStrip.Items) { if (!this.TabItems.Contains(tab)) { tabStrip.SelectedItem = tab; break; } } } tabStrip.InvalidateMeasure(); tabStrip.InvalidateArrange(); tabStrip.UpdateLayout(); } } }
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (this.ElementState != ElementState.Loaded) { return; } if (RadPageViewStripElement.PropertyInvalidatesScrollOffset(e.Property)) { this.ResetScrollOffset(); } else if (e.Property == BoundsProperty) { RadPageViewElement parent = this.FindAncestor <RadPageViewElement>(); if (parent != null) { parent.OnContentBoundsChanged(); } } }
protected void UpdateUI() { RadPageViewPage selectedPage = this.SelectedPage; RadPageViewPage defaultPage = this.DefaultPage; bool selectionWrap = this.SelectionWrap; bool useMnemonic = this.UseMnemonic; if (this.viewElement != null) { this.viewElement.Dispose(); } this.viewElement = this.CreateUI(); this.viewElement.Owner = this; this.SuspendEvents(); foreach (RadPageViewPage page in this.pages) { this.viewElement.OnPageAdded(new RadPageViewEventArgs(page)); } this.RootElement.Children.Add((RadElement)this.viewElement); if (selectedPage != null) { this.SelectedPage = selectedPage; } if (defaultPage != null && this.IsInitializing) { this.DefaultPage = defaultPage; } if (selectionWrap != this.SelectionWrap) { this.SelectionWrap = selectionWrap; } if (useMnemonic != this.UseMnemonic) { this.UseMnemonic = useMnemonic; } this.ResumeEvents(); }
public RadPageViewDragDropService(RadPageViewElement owner) { this.owner = owner; this.ValidCursor = DefaultValidCursor; }
public RadPageViewInDockDragDropService(RadPageViewElement owner) : base(owner) { this.owner = owner; }
public PageViewInstanceCreatedEventArgs(RadPageViewElement pageViewElement) { this.PageViewElement = pageViewElement; }
public RibbonBarCaptionLayoutPanel(RadRibbonBarElement ribbonBarElement) { this.tabStripElement = ribbonBarElement.TabStripElement; this.contextualTabGroups = ribbonBarElement.ContextualTabGroups; this.ribbonBarElement = ribbonBarElement; }