Пример #1
0
		public PlanDesignerViewModel(PlansViewModel plansViewModel)
		{
			PlansViewModel = plansViewModel;
			DesignerCanvas = new DesignerCanvas(this);
			DesignerCanvas.Toolbox.IsRightPanel = true;
			DesignerCanvas.Toolbox.RegisterInstruments(new[]
			{
				new InstrumentViewModel()
				{
					ImageSource="Subplan",
					ToolTip="Ссылка на план",
					Index = 1000,
					Adorner = new SubPlanRectangleAdorner(DesignerCanvas),
					GroupIndex = 1000,
				},
				new InstrumentViewModel()
				{
					ImageSource="Subplan",
					ToolTip="Ссылка на план",
					Index = 1001,
					Adorner = new SubPlanPolygonAdorner(DesignerCanvas),
					GroupIndex = 1000,
				},
			});
			AllowScalePoint = true;
			FullScreenSize = true;
		}
Пример #2
0
		public PlanDesignerViewModel(PlansViewModel plansViewModel)
		{
			PlansViewModel = plansViewModel;
			DesignerCanvas = new DesignerCanvas(this);
			DesignerCanvas.Toolbox.IsRightPanel = true;
			DesignerCanvas.Toolbox.RegisterInstruments(new[]{
				new InstrumentViewModel()
				{
				    ImageSource="/Controls;component/Images/Subplan.png",
				    ToolTip="Ссылка на план",
				    Index = 300,
				    Adorner = new SubPlanAdorner(DesignerCanvas),
				}});
			AllowScalePoint = true;
		}
Пример #3
0
        public ElementsViewModel(DesignerCanvas designerCanvas)
        {
            ServiceFactory.Events.GetEvent<ElementAddedEvent>().Unsubscribe(OnElementAdded);
            ServiceFactory.Events.GetEvent<ElementRemovedEvent>().Unsubscribe(OnElementRemoved);
            ServiceFactory.Events.GetEvent<ElementChangedEvent>().Unsubscribe(OnElementChanged);
            ServiceFactory.Events.GetEvent<ElementSelectedEvent>().Unsubscribe(OnElementSelected);

            ServiceFactory.Events.GetEvent<ElementAddedEvent>().Subscribe(OnElementAdded);
            ServiceFactory.Events.GetEvent<ElementRemovedEvent>().Subscribe(OnElementRemoved);
            ServiceFactory.Events.GetEvent<ElementChangedEvent>().Subscribe(OnElementChanged);
            ServiceFactory.Events.GetEvent<ElementSelectedEvent>().Subscribe(OnElementSelected);
            DesignerCanvas = designerCanvas;

            Elements = new ObservableCollection<ElementBaseViewModel>();
            Update();
        }
Пример #4
0
        public PlansViewModel()
        {
            ServiceFactory.Events.GetEvent<ShowElementEvent>().Subscribe(OnShowElement);
            ServiceFactory.Events.GetEvent<FindElementEvent>().Subscribe(OnShowElementDevice);

            AddCommand = new RelayCommand(OnAdd);
            AddSubPlanCommand = new RelayCommand(OnAddSubPlan, CanAddEditRemove);
            RemoveCommand = new RelayCommand(OnRemove, CanAddEditRemove);
            EditCommand = new RelayCommand(OnEdit, CanAddEditRemove);
            AddSubPlanCommand = new RelayCommand(OnAddSubPlan, CanAddEditRemove);

            DesignerCanvas = new DesignerCanvas();
            DesignerCanvas.Toolbox = new ToolboxViewModel(this);
            PlanDesignerViewModel = new PlanDesignerViewModel();
            PlanDesignerViewModel.DesignerCanvas = DesignerCanvas;

            InitializeCopyPaste();
            InitializeHistory();
            ElementsViewModel = new ElementsViewModel(DesignerCanvas);
            PlansTreeViewModel = new PlansTreeViewModel(this);
            CreatePages();
            _planExtensions = new List<Infrustructure.Plans.IPlanExtension<Plan>>();
            Menu = new PlansMenuViewModel(this);
        }
Пример #5
0
 public PolylineAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
Пример #6
0
 public PolygonAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
Пример #7
0
 public RectangleAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
Пример #8
0
 public SubPlanAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
Пример #9
0
 public TextBoxAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }