public void Init(Service setService)
		{
			service = setService;
			DataContext = uiEditorViewModel = new UIEditorViewModel(setService);
			service.ProjectChanged += ResetViewModel;
			service.ProjectChanged +=
				() => Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
			service.ContentUpdated +=
				(type, s) =>
					Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
			service.ContentDeleted +=
				s => Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
			Messenger.Default.Register<string>(this, "SetMaterial", SetMaterial);
			Messenger.Default.Register<string>(this, "SetHoveredMaterial", SetHoveredMaterial);
			Messenger.Default.Register<string>(this, "SetPressedMaterial", SetPressedMaterial);
			Messenger.Default.Register<string>(this, "SetDisabledMaterial", SetDisabledMaterial);
			Messenger.Default.Register<string>(this, "SetHorizontalAllignment", SetHorizontalAllignment);
			Messenger.Default.Register<string>(this, "SetVerticalAllignment",
				SetVerticalAllignmentToNull);
			Messenger.Default.Register<string>(this, "EnabledHoveredButton", EnabledHoveredButton);
			Messenger.Default.Register<string>(this, "EnabledPressedButton", EnabledPressedButton);
			Messenger.Default.Register<string>(this, "EnabledDisableButton", EnabledDisableButton);
			Messenger.Default.Register<string>(this, "EnableButtonChanger", EnableButtonChanger);
			Messenger.Default.Register<string>(this, "EnableTextChanger", EnableTextChanger);
			Messenger.Default.Register<string>(this, "RemoveProjectUpdate", RemoveProjectUpdate);
		}
 public void Init(Service setService)
 {
     service                 = setService;
     DataContext             = uiEditorViewModel = new UIEditorViewModel(setService);
     service.ProjectChanged += ResetViewModel;
     service.ProjectChanged +=
         () => Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
     service.ContentUpdated +=
         (type, s) =>
         Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
     service.ContentDeleted +=
         s => Dispatcher.Invoke(new Action(uiEditorViewModel.UiEditorScene.RefreshOnContentChange));
     Messenger.Default.Register <string>(this, "SetMaterial", SetMaterial);
     Messenger.Default.Register <string>(this, "SetHoveredMaterial", SetHoveredMaterial);
     Messenger.Default.Register <string>(this, "SetPressedMaterial", SetPressedMaterial);
     Messenger.Default.Register <string>(this, "SetDisabledMaterial", SetDisabledMaterial);
     Messenger.Default.Register <string>(this, "SetHorizontalAllignment", SetHorizontalAllignment);
     Messenger.Default.Register <string>(this, "SetVerticalAllignment",
                                         SetVerticalAllignmentToNull);
     Messenger.Default.Register <string>(this, "EnabledHoveredButton", EnabledHoveredButton);
     Messenger.Default.Register <string>(this, "EnabledPressedButton", EnabledPressedButton);
     Messenger.Default.Register <string>(this, "EnabledDisableButton", EnabledDisableButton);
     Messenger.Default.Register <string>(this, "EnableButtonChanger", EnableButtonChanger);
     Messenger.Default.Register <string>(this, "EnableTextChanger", EnableTextChanger);
     Messenger.Default.Register <string>(this, "RemoveProjectUpdate", RemoveProjectUpdate);
 }
Beispiel #3
0
 public ControlProcessor(UIEditorViewModel uiEditorViewModel)
 {
     this.uiEditorViewModel = uiEditorViewModel;
     OutLines = new Line2D[4];
     CreateOutlines();
 }