public ToolBoxViewModel(IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; eventAggregator.Subscribe(this); Title = "ToolBox - Select the DeviceType"; //var t = GetNamespacesInAssembly(Assembly.GetExecutingAssembly()); //Type[] typelist = GetTypesInNamespace(Assembly.GetExecutingAssembly(), "CockpitBuilder.Plugins."); //List<string> finallist = typelist.Select(x => x.ToString().Replace("CockpitBuilder.Plugins.", "").Replace("_ViewModel", "")).ToList(); //DeviceTypes = new BindableCollection<string>(finallist ); //selectedDeviceType = DeviceTypes[0]; //Type[] GetTypesInNamespace(Assembly assembly, string nameSpace) //{ // double f = 0; // return // assembly.GetTypes() // .Where(t => String.Equals(t.Namespace, nameSpace, StringComparison.Ordinal) && t.FullName.EndsWith("_ViewModel")) // .ToArray(); //} LoadImage(@"J:\heliosDevices\Images"); }
public LayoutPropertyEditorViewModel(IEventAggregator eventAggregator, params object[] settings) { bool IsModeEditor = (bool)settings[0]; if (IsModeEditor) { var view = ViewLocator.LocateForModel(this, null, null); ViewModelBinder.Bind(this, view, null); } NameUC = (string)settings[1]; UCLeft = ((int[])settings[2])[0]; UCTop = ((int[])settings[2])[1]; var width = (double)((int[])settings[2])[2]; var height = (double)((int[])settings[2])[3]; SelectedSwitchRotation = (SwitchRotation)((int[])settings[2])[4]; Factor = height / width; Width = width; Height = height; this.eventAggregator = eventAggregator; eventAggregator.Subscribe(this); Name = "Layout"; }
public MainShellViewModel(IResultFactory resultFactory, IEventAggregator eventAggregator, MainMenuViewModel mainMenuViewModel, MainToolBarTrayViewModel mainToolBarViewModel, IEnumerable <PanelViewModel> panels, ISettingsManager settingsManager, IFileSystem fileSystem, IPersistanceManager persistanceManager, IPaths paths, IPortable portable ) : base(resultFactory) { this.eventAggregator = eventAggregator; eventAggregator.Subscribe(this); this.persistanceManager = persistanceManager; this.settingsManager = settingsManager; this.fileSystem = fileSystem; this.paths = paths; Menu = mainMenuViewModel; ToolBarTray = mainToolBarViewModel; Scripts = new BindableCollection <MonitorViewModel>(); Tools = new BindableCollection <PanelViewModel>(panels); mainMenuViewModel.NewProfile(); }
public ThreeWayToggleSwitchAppearanceEditorViewModel(IEventAggregator eventAggregator, params object[] settings) { bool IsModeEditor = (bool)settings[0]; if (IsModeEditor) { var view = ViewLocator.LocateForModel(this, null, null); ViewModelBinder.Bind(this, view, null); } NameUC = (string)settings[1]; var index = 3; PositionImage0 = ((string[])settings[index])[0]; PositionImage1 = ((string[])settings[index])[1]; PositionImage2 = ((string[])settings[index])[2]; PositionIndicatorImage0 = ((string[])settings[index])[3]; PositionIndicatorImage1 = ((string[])settings[index])[4]; PositionIndicatorImage2 = ((string[])settings[index++])[5]; IndexImage = (int)settings[index++]; Has3Images = !string.IsNullOrEmpty(PositionImage2); hasIndicator = !string.IsNullOrEmpty(PositionIndicatorImage0); //Has3Images = true; //HasIndicator = false; this.eventAggregator = eventAggregator; eventAggregator.Subscribe(this); Name = "Appareance"; }
public MonitorPropertyEditorViewModel(IEventAggregator eventAggregator) { var view = ViewLocator.LocateForModel(this, null, null); ViewModelBinder.Bind(this, view, null); this.eventAggregator = eventAggregator; Name = "Monitor"; FillBackground = false; BackgroundColor = Colors.Gray; BackgroundColor1 = color1; BackgroundColor2 = color2; eventAggregator.Subscribe(this); }
public MainToolBarTrayViewModel(IEventAggregator eventAggregator) { AlignTop = new RelayCommand(o => cmdAlign(2), o => true); AlignBottom = new RelayCommand(o => cmdAlign(3), o => true); AlignLeft = new RelayCommand(o => cmdAlign(4), o => true); AlignRight = new RelayCommand(o => cmdAlign(5), o => true); AlignHorizontalCenter = new RelayCommand(o => cmdAlign(6), o => true); AlignVerticalCenter = new RelayCommand(o => cmdAlign(7), o => true); DistributeHorizontalCenter = new RelayCommand(o => cmdAlign(8), o => true); DistributeVerticalCenter = new RelayCommand(o => cmdAlign(9), o => true); SpaceHorizontal = new RelayCommand(o => cmdAlign(10), o => true); SpaceVertical = new RelayCommand(o => cmdAlign(11), o => true); eventAggregator.Subscribe(this); }
public PushButtonAppearanceEditorViewModel(IEventAggregator eventAggregator, params object[] settings) { bool IsModeEditor = (bool)settings[0]; if (IsModeEditor) { var view = ViewLocator.LocateForModel(this, null, null); ViewModelBinder.Bind(this, view, null); } NameUC = (string)settings[1]; HAlignTypes = Enum.GetValues(typeof(HorizontalAlignment)).Cast <HorizontalAlignment>().Take(3).ToList(); VAlignTypes = Enum.GetValues(typeof(VerticalAlignment)).Cast <VerticalAlignment>().Take(3).ToList(); var index = 3; Image = ((string[])settings[index])[0]; PushedImage = ((string[])settings[index++])[1]; IndexImage = (int)settings[index++]; GlyphThickness = (double)settings[index++]; GlyphScale = (double)settings[index++]; SelectedPushButtonGlyph = (PushButtonGlyph)(int)settings[index++]; GlyphColor = (Color)settings[index++]; GlyphText = (string)settings[index++]; TextPushOffset = (string)settings[index++]; TextFormat = new TextFormat(fontFamily: (string)settings[index++], fontStyle: (string)settings[index++], //Normal, Oblique or Italic see FontStyles fontWeight: (string)settings[index++], //Thin.... see FontWeight fontSize: (double)settings[index++], padding: (double[])settings[index++], //Padding L,T,R,B Alignment: (int[])settings[index] //Left, Center, Right and Top, center, Bottom ); SelectedHAlignType = (HorizontalAlignment)((int[])settings[index])[0]; SelectedVAlignType = (VerticalAlignment)((int[])settings[index])[1]; TextColor = (Color)settings[++index]; eventAggregator.Subscribe(this); this.eventAggregator = eventAggregator; Name = "Appearance"; }
public ThreeWayToggleSwitchBehaviorEditorViewModel(IEventAggregator eventAggregator, params object[] settings) { var index = 0; bool IsModeEditor = (bool)settings[index++]; if (IsModeEditor) { var view = ViewLocator.LocateForModel(this, null, null); ViewModelBinder.Bind(this, view, null); } this.eventAggregator = eventAggregator; SwitchOrientation = Enum.GetValues(typeof(SwitchOrientation)).Cast <SwitchOrientation>().ToList(); eventAggregator.Subscribe(this); Name = "Behavior"; }