protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); this.currentSize = SizeF.Empty; this.forcedLayoutSize = SizeF.Empty; }
protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); this.itemToEnsureVisible = (RadPageViewItem)null; this.layoutInfo = (StripViewLayoutInfo)null; this.scrollAnimation.Stop((RadObject)this); }
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property != RadElement.VisibilityProperty) { return; } ComponentThemableElementTree elementTree = this.ElementTree; if (elementTree == null) { return; } Control control = elementTree.Control; if (control == null) { return; } RadFormControlBase radFormControlBase = control as RadFormControlBase; if (radFormControlBase == null || radFormControlBase.FormBorderStyle == FormBorderStyle.None) { return; } radFormControlBase.InvalidateIfNotSuspended(); radFormControlBase.CallSetClientSizeCore(radFormControlBase.ClientSize.Width, radFormControlBase.ClientSize.Height); }
protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); this.itemToEnsureVisible = null; this.layoutInfo = null; this.scrollAnimation.Stop(this); }
public SnapshotDragItem(RadItem item) { this.supportDrag = (ISupportDrag)item; this.context = this.supportDrag.GetDataContext(); this.hint = this.InitializeDragHint(); this.AllowDrag = this.supportDrag.AllowDrag; this.controlBoundingRectangle = item.ControlBoundingRectangle; this.elementTree = item.ElementTree; }
protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); if (oldTree.Control == null) { return; } oldTree.Control.BindingContextChanged -= new EventHandler(this.Control_BindingContextChanged); }
protected override void OnElementTreeChanged(ComponentThemableElementTree previousTree) { base.OnElementTreeChanged(previousTree); if (previousTree != null) { ((RadControl)previousTree.Control).ElementInvalidated -= new EventHandler(this.CarouselContentItem_ElementInvalidated); } if (this.ElementTree == null) { return; } ((RadControl)this.ElementTree.Control).ElementInvalidated += new EventHandler(this.CarouselContentItem_ElementInvalidated); }
protected override void OnElementTreeChanged(ComponentThemableElementTree previousTree) { base.OnElementTreeChanged(previousTree); if (previousTree != null) { ((RadControl)previousTree.Control).ElementInvalidated -= CarouselContentItem_ElementInvalidated; } if (this.ElementTree != null) { ((RadControl)this.ElementTree.Control).ElementInvalidated += CarouselContentItem_ElementInvalidated; } }
private void UpdateSelectedState() { if (this.MasterTemplate.SelectionMode == GridViewSelectionMode.CellSelect) { this.synchronizeSelectedState = false; this.IsCurrent = false; this.IsSelected = false; this.selectionLost = true; } else { ComponentThemableElementTree elementTree = this.ElementTree; if (elementTree == null) { return; } Control control = elementTree.Control; if (control == null) { return; } if (this.GridViewElement.HideSelection && !control.Focused && !control.ContainsFocus) { if (this.selectionLost) { return; } this.selectionLost = true; this.synchronizeSelectedState = false; this.IsCurrent = false; this.IsSelected = false; } else { if (!this.selectionLost) { return; } this.selectionLost = false; this.synchronizeSelectedState = true; if (this.MasterTemplate.SelectionMode == GridViewSelectionMode.None) { return; } this.IsCurrent = this.RowInfo.IsCurrent; this.IsSelected = this.RowInfo.IsSelected; } } }
private void Control_MouseUp(object sender, MouseEventArgs e) { if (!this.dragging) { return; } if (targetListBox != null) { targetComponentElementTree = targetListBox.ElementTree; if (targetComponentElementTree.RootElement.ElementTree != null && this.AllowDragDrop) { targetComponentElementTree.RootElement.ElementTree.Control.Capture = false; if (e.Button == MouseButtons.Left) { if (this.outlineForm != null) { this.outlineForm.Hide(); } if (this.feedBackForm != null) { this.feedBackForm.Hide(); } EndDrag(e); } } } if (this.outlineForm != null) { this.outlineForm.Hide(); this.outlineForm.Dispose(); this.outlineForm = null; this.draggedItem = null; this.replacedItem = null; this.dragging = false; this.isRealDrag = false; } if (this.feedBackForm != null) { this.feedBackForm.Hide(); this.feedBackForm.Dispose(); this.feedBackForm = null; this.dragging = false; this.isRealDrag = false; } sourceListBox.FindForm().Cursor = Cursors.Arrow; }
public void ApplyStyleToVirtualElement(RadElement element) { if (!element.IsInValidState(false)) { return; } if (!element.PropagateStyleToChildren || element.IsThemeRefreshSuspended) { return; } if (this.state == StyleManagerState.Detaching || this.state == StyleManagerState.Detached) { return; } ComponentThemableElementTree oldTree = element.ElementTree; element.UpdateReferences(this.owner.ElementTree, false, true); this.MapStylesToElementsRecursive(element); bool parentNotPropagateStyleToChildren; StyleMap map = this.FindStyleMapForElement(element, out parentNotPropagateStyleToChildren); if (map != null) { if (this.styleElementMap.ContainsKey(element.GetHashCode())) { this.styleElementMap.Remove(element.GetHashCode()); } else { map.BuildStyle(); map.SetStyleSheet(element.ComposeStyle()); } map.OnElementRemoved(element); } element.UpdateReferences(oldTree, false, true); }
private void InitializeDragOperation(object sender, MouseEventArgs e) { sourceListBox = (RadListControl)sender; sourceComponentElementTree = sourceListBox.ElementTree; if (sourceComponentElementTree.RootElement.ElementTree != null && this.AllowDragDrop) { RadElement elementAtPoint = sourceComponentElementTree.GetElementAtPoint(e.Location); if (elementAtPoint is RadListVisualItem) { if (e.Button == MouseButtons.Left) { sourceComponentElementTree.RootElement.ElementTree.Control.Capture = true; BeginDrag(e); } } } }
protected void SetElementTree(ComponentThemableElementTree value) { this.elementTree = value; }
private void DrawFeedBack(MouseEventArgs e) { if (targetListBox == null) { feedBackForm.Hide(); return; } this.targetComponentElementTree = this.targetListBox.ElementTree; Point p4 = new Point(); p4 = sourceListBox.PointToScreen(new Point(e.X, e.Y)); p4 = targetListBox.PointToClient(p4); RadElement elementAtPoint = targetComponentElementTree.GetElementAtPoint(p4); RadListVisualItem visualReplacedItem = elementAtPoint as RadListVisualItem; this.replacedItem = visualReplacedItem != null ? visualReplacedItem.Data : null; if (visualReplacedItem == null) { feedBackForm.Hide(); return; } if (visualReplacedItem != null) { int UpperBound = visualReplacedItem.Bounds.Height * this.targetListBox.Items.IndexOf(this.replacedItem); int MiddleBound = UpperBound + visualReplacedItem.Bounds.Height / 2; int LowerBound = UpperBound + visualReplacedItem.Bounds.Height; if (p4.Y < UpperBound || p4.Y > LowerBound) { //FeedBack shouldnt be drawn feedBackForm.StartPoint = null; } if (p4.Y <= MiddleBound && p4.Y > UpperBound) { //FeedBack should be drawn above the replceditem feedBackForm.StartPoint = this.targetListBox.PointToScreen(new Point(0 + 3, UpperBound + 1)); } if (p4.Y <= LowerBound && p4.Y > MiddleBound) { //FeedBack should be drawn below the replaceditem feedBackForm.StartPoint = this.targetListBox.PointToScreen(new Point(0 + 3, UpperBound + 1 + visualReplacedItem.Bounds.Height)); } } if (elementAtPoint is RadListElement) { if (targetListBox.Items.Count > 0) { RadListDataItem lastItem = this.targetListBox.Items[this.targetListBox.Items.Count - 1]; //FeedBack should be drawn always below the last item of the targetListBox if (feedBackForm == null) { return; } feedBackForm.StartPoint = this.targetListBox.PointToScreen(new Point(3, 1 + lastItem.VisualItem.Bounds.Height * this.targetListBox.Items.IndexOf(lastItem) + lastItem.VisualItem.Bounds.Height)); } else { feedBackForm.StartPoint = null; } } SetFeedBackForm(); }
protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); this.UpdateImage(); }
protected override void OnUnloaded(ComponentThemableElementTree oldTree) { base.OnUnloaded(oldTree); LocalizationProvider <RadPageViewLocalizationProvider> .CurrentProviderChanged -= new EventHandler(this.RadPageViewLocalizationProvider_CurrentProviderChanged); this.providerAttached = false; }