Beispiel #1
0
 private void OnPrePropertyChangedEvent(object sender, PrePropertyChangedEventArgs e)
 {
     if (PrePropertyChangedEvent != null)
     {
         PrePropertyChangedEvent(sender, e);
     }
 }
        protected virtual void OnVisibility()
        {
            if (Element.ParentElement.Visible == Visibility.Hidden)
            {
                return;
            }

            IElement parent = Element.ParentElement;
            RectLayer old = new RectLayer();
            if (parent == null && Element is RectLayer)
            {
                old = (RectLayer)((RectLayer)Element).Clone();
            }
            else
            {
                while (parent.ParentElement != null)
                {
                    parent = parent.ParentElement;
                }
                old = (RectLayer)((RectLayer)parent).Clone();
            }


            if (Visible == Visibility.Visible)
            {
                Visible = Visibility.Hidden;
            }
            else if(Visible==Visibility.Hidden)
            {
                Visible = Visibility.Visible;
            }


            RectLayer newValue = new RectLayer();
            IElement newParent = Element.ParentElement;
            while (newParent.ParentElement != null)
            {
                newParent = newParent.ParentElement;
            }
            newValue = (RectLayer)((RectLayer)newParent).Clone();
            PrePropertyChangedEventArgs actionValue = new PrePropertyChangedEventArgs() { PropertyName = "ElementCollection", OldValue = old, NewValue = newValue };
            Messenger.Default.Send<PrePropertyChangedEventArgs>(actionValue, MsgToken.MSG_RECORD_ACTIONVALUE);
    
        }
 private void OnRecordActionValueChanged(PrePropertyChangedEventArgs e)
 {
     RectElement rectElement = new RectElement();
     //RectLayerChangedAction action;
     //action = new RectLayerChangedAction(MyRectLayer, e.PropertyName, ((RectLayer)e.NewValue).ElementCollection, ((RectLayer)e.OldValue).ElementCollection);
     //SmartLCTActionManager.RecordAction(action);
 }
 private void OnRecordActionValueChanged(PrePropertyChangedEventArgs e)
 {
     RectLayerChangedAction action;
     action = new RectLayerChangedAction(ScreenRealParams.ScreenLayer.ParentElement, e.PropertyName, ((RectLayer)e.NewValue).ElementCollection, ((RectLayer)e.OldValue).ElementCollection);
     SmartLCTActionManager.RecordAction(action);
 }