Beispiel #1
0
		public void Show(PresenterItem presenterItem)
		{
			_presenterItem = presenterItem;
			UpdateBounds();
			_transform.ScaleX = 1;
			_transform.ScaleY = 1;
		}
Beispiel #2
0
		public void Show(PresenterItem presenterItem)
		{
			if (_timer.IsEnabled || Parent != null)
				Hide();
			_flushControl.SetPresenterItem(presenterItem);
			_flushControl.Show();
			AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(Canvas);
			if (adornerLayer != null)
				adornerLayer.Add(this);
			_timer.Start();
		}
Beispiel #3
0
		public ZonePainter(PresenterItem presenterItem)
			: base(presenterItem.Element)
		{
			_contextMenu = null;
			_presenterItem = presenterItem;
			_presenterItem.ShowBorderOnMouseOver = true;
			_presenterItem.ContextMenuProvider = CreateContextMenu;
			_zone = Helper.GetZone((IElementZone)_presenterItem.Element);
			if (_zone != null)
				_zone.ZoneState.StateChanged += OnPropertyChanged;
			_presenterItem.Title = GetZoneTooltip();
			//_presenterItem.Cursor = Cursors.Hand;
			//_presenterItem.ClickEvent += (s, e) => OnShowProperties();
			InitializeDevices();
		}
		public XDirectionPainter(PresenterItem presenterItem)
			: base(presenterItem.Element)
		{
			_textDrawing = null;
			_scaleTransform = new ScaleTransform();
			_contextMenu = null;
			_presenterItem = presenterItem;
			_presenterItem.ShowBorderOnMouseOver = true;
			_presenterItem.ContextMenuProvider = CreateContextMenu;
			_direction = Helper.GetXDirection((IElementDirection)_presenterItem.Element);
			_showText = _direction != null && _presenterItem.Element is ElementRectangleXDirection;
			if (_direction != null)
				_direction.State.StateChanged += OnPropertyChanged;
			_presenterItem.Cursor = Cursors.Hand;
			_presenterItem.ClickEvent += (s, e) => OnShowProperties();
			UpdateTooltip();
		}
Beispiel #5
0
		public XZonePainter(PresenterItem presenterItem)
			: base(presenterItem.Element)
		{
			_contextMenu = null;
			_presenterItem = presenterItem;
			_presenterItem.ShowBorderOnMouseOver = true;
			_presenterItem.ContextMenuProvider = CreateContextMenu;
			Zone = Helper.GetXZone((IElementZone)_presenterItem.Element);
			if (Zone != null)
			{
				ZoneViewModel = new ViewModels.ZoneViewModel(Zone);
				Zone.State.StateChanged += OnPropertyChanged;
			}
			_presenterItem.Cursor = Cursors.Hand;
			_presenterItem.ClickEvent += (s, e) => ShowProperties();
			UpdateTooltip();
		}
Beispiel #6
0
		public XDevicePainter(PresenterItem presenterItem)
			: base(presenterItem.Element)
		{
			_contextMenu = null;
			var elementXDevice = presenterItem.Element as ElementXDevice;
			if (elementXDevice != null)
			{
				Device = Helper.GetXDevice(elementXDevice);
				if (Device != null && Device.State != null)
					Device.State.StateChanged += OnPropertyChanged;
			}
			_presenterItem = presenterItem;
			_presenterItem.IsPoint = true;
			_presenterItem.ShowBorderOnMouseOver = true;
			_presenterItem.ContextMenuProvider = CreateContextMenu;
			_presenterItem.Cursor = Cursors.Hand;
			_presenterItem.ClickEvent += (s, e) => OnShowProperties();
			UpdateTooltip();
		}
Beispiel #7
0
		public DevicePainter(PresenterItem presenterItem)
			: base(presenterItem.Element)
		{
			_contextMenu = null;
			_elementDevice = presenterItem.Element as ElementDevice;
			if (_elementDevice != null)
			{
				_device = Helper.GetDevice(_elementDevice);
				if (_device != null)
				{
					_device.DeviceState.StateChanged += OnPropertyChanged;
					_device.DeviceState.ParametersChanged += OnParametersChanged;
				}
			}
			_presenterItem = presenterItem;
			_presenterItem.IsPoint = true;
			_presenterItem.ShowBorderOnMouseOver = true;
			_presenterItem.ContextMenuProvider = CreateContextMenu;
			_presenterItem.Title = GetDeviceTooltip();
			_presenterItem.Cursor = Cursors.Hand;
			_presenterItem.ClickEvent += (s, e) => OnShowProperties();
		}
Beispiel #8
0
		public void SetPresenterItem(PresenterItem presenterItem)
		{
			PresenterItem = presenterItem;
			SetPresenterItem();
		}
Beispiel #9
0
		public PresenterItem CreatePresenterItem(ElementBase elementBase)
		{
			var presenterItem = new PresenterItem(elementBase);
			Add(presenterItem);
			return presenterItem;
		}
		public void Navigate(PresenterItem presenterItem)
		{
			_flushAdorner.Show(presenterItem);
		}
Beispiel #11
0
		public void Hide()
		{
			_presenterItem = null;
			_transform.ScaleX = 0;
			_transform.ScaleY = 0;
		}