private void OnMoveForward(DesignerItem item)
		{
			IEnumerable<DesignerItem> upperItems = this.DesignerCanvas.Items
				.Where(x => x.Element.ZIndex >= item.Element.ZIndex && x != item)
				.OrderBy(x => x.Element.ZIndex);
			DesignerItem closestItem = upperItems.FirstOrDefault();
			// Switching current Item and the closest one:
			if (closestItem != null)
				closestItem.Element.ZIndex = item.Element.ZIndex;
			item.Element.ZIndex++;
			foreach (DesignerItem upperItem in upperItems.Skip(1))
				upperItem.Element.ZIndex++;
		}
		public override void RegisterDesignerItem(DesignerItem designerItem)
		{
			base.RegisterDesignerItem(designerItem);
			if (designerItem.Element is ElementPassCardImageProperty)
			{
				designerItem.Group = PassCardDesignerViewModel.PassCardImagePropertiesGroup;
				designerItem.Title = ((ElementPassCardImageProperty)designerItem.Element).Text.Replace('\n', ' ');
				designerItem.UpdateProperties += DesignerItemPropertyChanged;
			}
			else if (designerItem.Element is ElementPassCardTextProperty)
			{
				designerItem.Group = PassCardDesignerViewModel.PassCardTextPropertiesGroup;
				designerItem.Title = ((ElementPassCardTextProperty)designerItem.Element).Text.Replace('\n', ' ');
				designerItem.UpdateProperties += DesignerItemPropertyChanged;
			}
		}
Exemple #3
0
		public ElementViewModel(DesignerItem designerItem)
		{
			ShowOnPlanCommand = new RelayCommand(OnShowOnPlan);
			DesignerItem = designerItem;
			DesignerItem.IndexPropertyChanged += (s, e) =>
			{
				OnPropertyChanged(() => Index);
				OnPropertyChanged(() => ToolTip);
			};
			DesignerItem.TitleChanged += (s, e) =>
			{
				OnPropertyChanged(() => Name);
				OnPropertyChanged(() => ToolTip);
			};
			IsGroupHasChild = true;
			IconSource = DesignerItem.IconSource;
			DesignerItem.IconSourceChanged += (s, e) =>
			{
				IconSource = DesignerItem.IconSource;
				OnPropertyChanged(() => IconSource);
				OnPropertyChanged(() => ToolTip);
			};
		}
		public override void RegisterDesignerItem(DesignerItem designerItem)
		{
			base.RegisterDesignerItem(designerItem);
			PlansViewModel.RegisterDesignerItem(designerItem);
		}
		public virtual void RegisterDesignerItem(DesignerItem designerItem)
		{
		}
Exemple #6
0
		public ResizeChromePoint(DesignerItem designerItem)
			: base(designerItem)
		{
			PrepareBounds();
		}
Exemple #7
0
		public ResizeChrome(DesignerItem designerItem)
		{
			_isRendered = true;
			_visibleTransform = new ScaleTransform(0, 0);
			_canResize = false;
			_isVisible = false;
			DesignerItem = designerItem;
			ResetElement();
		}
		public void RegisterDesignerItem(DesignerItem designerItem)
		{
			foreach (var planExtension in _planExtensions)
				planExtension.RegisterDesignerItem(designerItem);
		}
		public ResizeChromeRectangle(DesignerItem designerItem)
			: base(designerItem)
		{
			PrepareSizableBounds();
		}
Exemple #10
0
		public void RemoveDesignerItem(DesignerItem designerItem)
		{
			RemoveElement(designerItem.Element);
			Remove(designerItem);
			Refresh();
			designerItem.OnRemoved();
		}
		private void OnMoveBackward(DesignerItem item)
		{
			IEnumerable<DesignerItem> lowerItems = this.DesignerCanvas.Items
				.Where(x => x.Element.ZIndex <= item.Element.ZIndex && x != item)
				.OrderByDescending(x => x.Element.ZIndex);
			DesignerItem closestItem = lowerItems.FirstOrDefault();
			// Switching current Item and the closest one:
			if (closestItem != null)
				closestItem.Element.ZIndex = item.Element.ZIndex;
			item.Element.ZIndex--;
			// Moving all the lower items down to keep Order:
			foreach (DesignerItem lowerItem in lowerItems.Skip(1)) // Skipping the closest Item
				lowerItem.Element.ZIndex--;
		}