public override void LeaveContainer(PlacementOperation operation)
 {
     GrayOutDesignerExceptActiveArea.Stop(ref grayOut);
     base.LeaveContainer(operation);
     foreach (PlacementInformation info in operation.PlacedItems)
     {
         info.Item.Properties.GetAttachedProperty(Canvas.LeftProperty).Reset();
         info.Item.Properties.GetAttachedProperty(Canvas.TopProperty).Reset();
     }
 }
Example #2
0
 protected override void OnStopped()
 {
     if (adornerPanel != null)
     {
         designPanel.Adorners.Remove(adornerPanel);
         adornerPanel = null;
     }
     GrayOutDesignerExceptActiveArea.Stop(ref grayOut);
     selectionFrame = null;
     base.OnStopped();
 }
Example #3
0
        public override void LeaveContainer(PlacementOperation operation)
        {
            GrayOutDesignerExceptActiveArea.Stop(ref grayOut);
            base.LeaveContainer(operation);
            foreach (PlacementInformation info in operation.PlacedItems)
            {
                if (info.Item.ComponentType == typeof(ColumnDefinition))
                {
                    // TODO: combine the width of the deleted column with the previous column
                    this.ExtendedItem.Properties["ColumnDefinitions"].CollectionElements.Remove(info.Item);
                }
                else if (info.Item.ComponentType == typeof(RowDefinition))
                {
                    this.ExtendedItem.Properties["RowDefinitions"].CollectionElements.Remove(info.Item);
                }
                else
                {
                    info.Item.Properties.GetAttachedProperty(Grid.RowProperty).Reset();
                    info.Item.Properties.GetAttachedProperty(Grid.ColumnProperty).Reset();
                    info.Item.Properties.GetAttachedProperty(Grid.RowSpanProperty).Reset();
                    info.Item.Properties.GetAttachedProperty(Grid.ColumnSpanProperty).Reset();

                    HorizontalAlignment ha = (HorizontalAlignment)info.Item
                                             .Properties[FrameworkElement.HorizontalAlignmentProperty]
                                             .ValueOnInstance;
                    VerticalAlignment va = (VerticalAlignment)info.Item
                                           .Properties[FrameworkElement.VerticalAlignmentProperty]
                                           .ValueOnInstance;

                    if (ha == HorizontalAlignment.Stretch)
                    {
                        info.Item.Properties[FrameworkElement.WidthProperty].SetValue(info.Bounds.Width);
                    }
                    if (va == VerticalAlignment.Stretch)
                    {
                        info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
                    }
                }
            }
        }
 public override void EndPlacement(PlacementOperation operation)
 {
     GrayOutDesignerExceptActiveArea.Stop(ref grayOut);
     base.EndPlacement(operation);
 }
Example #5
0
 public override void EndPlacement(PlacementOperation operation)
 {
     GrayOutDesignerExceptActiveArea.Stop(ref grayOut);
     enteredIntoNewContainer = false;
     base.EndPlacement(operation);
 }