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; }
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; }
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(); }
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); }
public PolylineAdorner(DesignerCanvas designerCanvas) : base(designerCanvas) { }
public PolygonAdorner(DesignerCanvas designerCanvas) : base(designerCanvas) { }
public RectangleAdorner(DesignerCanvas designerCanvas) : base(designerCanvas) { }
public SubPlanAdorner(DesignerCanvas designerCanvas) : base(designerCanvas) { }
public TextBoxAdorner(DesignerCanvas designerCanvas) : base(designerCanvas) { }