Exemplo n.º 1
0
 public virtual void OnItemSelecting(object sender, RadPageViewItemSelectingEventArgs args)
 {
     if (this.ItemSelecting != null)
     {
         this.ItemSelecting(sender, args);
     }
 }
Exemplo n.º 2
0
        protected internal virtual void SetSelectedItem(RadPageViewItem item)
        {
            //no need to change selection
            if (this.selectedItem == item)
            {
                return;
            }

            if (UpdateSelectedItemContent)
            {
                this.SetSelectedContent(item);
            }

            RadPageViewItemSelectingEventArgs selectingEventArgs = new RadPageViewItemSelectingEventArgs(this.selectedItem, item);

            this.OnItemSelecting(this, selectingEventArgs);
            if (selectingEventArgs.Cancel)
            {
                return;
            }

            if (this.selectedItem != null)
            {
                this.selectedItem.IsSelected = false;
            }

            RadPageViewItem previousItem = this.selectedItem;

            this.selectedItem = item;

            if (this.selectedItem != null)
            {
                this.selectedItem.IsSelected = true;
                this.header.Text             = this.selectedItem.Title;
                this.footer.Text             = this.selectedItem.Description;

                if (this.EnsureSelectedItemVisible)
                {
                    this.EnsureItemVisibleCore(item);
                }
            }
            else
            {
                this.header.ResetValue(RadItem.TextProperty);
                this.footer.ResetValue(RadItem.TextProperty);
            }

            RadPageViewItemSelectedEventArgs selectedEventArgs = new RadPageViewItemSelectedEventArgs(previousItem, this.selectedItem);

            this.OnItemSelected(this, selectedEventArgs);
        }
Exemplo n.º 3
0
        private void tabStripElement_ItemSelecting(object sender, RadPageViewItemSelectingEventArgs e)
        {
            if (this.suspendStripSelecting > 0)
            {
                return;
            }
            TabStripItem nextItem = e.NextItem as TabStripItem;

            if (nextItem != null)
            {
                this.pageViewUpdate = true;
                if (!this.SelectTab(nextItem.TabPanel))
                {
                    e.Cancel = true;
                }
                this.pageViewUpdate = false;
            }
            else
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 4
0
        protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);

            if (e.Property.Name == "IsSelected" && (bool)e.NewValue && this.Owner != null)
            {
                foreach (RadPageViewItem item in this.Owner.Items)
                {
                    if (item != this && item.IsSelected)
                    {
                        RadPageViewItemSelectingEventArgs selectingEventArgs = new RadPageViewItemSelectingEventArgs(item, this);
                        this.Owner.OnItemSelecting(this, selectingEventArgs);

                        item.IsSelected = false;
                    }
                }

                this.Owner.selectedItem = this;

                RadPageViewItemSelectedEventArgs selectedEventArgs = new RadPageViewItemSelectedEventArgs(null, this);
                this.Owner.OnItemSelected(this, selectedEventArgs);
            }
        }