コード例 #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
ファイル: ElementsViewModel.cs プロジェクト: hjlfmy/Rubezh
        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
ファイル: PlansViewModel.cs プロジェクト: hjlfmy/Rubezh
        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
ファイル: PolylineAdorner.cs プロジェクト: hjlfmy/Rubezh
 public PolylineAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
コード例 #6
0
ファイル: PolygonAdorner.cs プロジェクト: hjlfmy/Rubezh
 public PolygonAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
コード例 #7
0
ファイル: RectangleAdorner.cs プロジェクト: hjlfmy/Rubezh
 public RectangleAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
コード例 #8
0
ファイル: SubPlanAdorner.cs プロジェクト: hjlfmy/Rubezh
 public SubPlanAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }
コード例 #9
0
ファイル: TextBoxAdorner.cs プロジェクト: hjlfmy/Rubezh
 public TextBoxAdorner(DesignerCanvas designerCanvas)
     : base(designerCanvas)
 {
 }