/// <summary> /// Called when mouse is up on the associated object /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param> private void OnMouseUp(object sender, MouseButtonEventArgs e) { ClearIllustrations(); if ((WindowsManager.ActiveWindowsManager != null) && (WindowsManager.ActiveWindowsManager.DraggedPane != null)) { LogicalParent.AddDockPane(DetachDockPaneFromWindowManager(), DockPoint); } }
public override INameScope FindNameScope() { if (this is INameScope) { return(this as INameScope); } if (TemplateNameScope != null) { return(TemplateNameScope); } return(LogicalParent == null ? Screen : LogicalParent.FindNameScope()); }
private ISelectionGroup <RadioButton> GetDefaultGroup() { if (LogicalParent == null) { return(null); } ISelectionGroup <RadioButton> group = (ISelectionGroup <RadioButton>)LogicalParent.GetValue(SelectionGroupProperty); if (group == null) { group = new SelectionGroup <RadioButton>(); LogicalParent.SetValue(SelectionGroupProperty, group); } return(group); }
public void Locate() { if (LogicalParent == null) { return; } Control parent = this.LogicalParent; double scaleX = parent.ActualWidth / this.ActualWidth; double scaleY = parent.ActualHeight / this.ActualHeight; if (scaleX < scaleY) { scaleY = scaleX; } else { scaleX = scaleY; } GeneralTransform gt = LogicalParent.TransformToVisual(this); Point ptTo = new Point(parent.ActualWidth * .5 - this.ActualWidth * .5, parent.ActualHeight * 0.5 - this.ActualHeight * .5); ptTo = gt.TransformPoint(ptTo); _compositeTransform.ScaleX = scaleX; _compositeTransform.ScaleY = scaleY; _compositeTransform.TranslateX = ptTo.X; _compositeTransform.TranslateY = ptTo.Y; this.UpdateLayout(); }