public DeviceLayoutViewModel(LayoutEditModel model, DeviceLayoutEditorViewModel editorViewModel, IWindowManager windowManager) { _windowManager = windowManager; Model = model; DeviceLayout = model.DeviceLayout; EditorViewModel = editorViewModel; LedViewModels = new BindableCollection <LedViewModel>(DeviceLayout.Leds.Select(l => new LedViewModel(Model, this, _windowManager, l))); UpdateLeds(); PropertyChanged += DeviceLayoutViewModelPropertyChanged; EditorViewModel.PropertyChanged += EditorViewModelOnPropertyChanged; var activeWindow = Application.Current.Windows.OfType <Window>().SingleOrDefault(x => x.IsActive); if (activeWindow != null) { activeWindow.KeyDown += KeyUpDown; activeWindow.KeyUp += KeyUpDown; } }
public AddImageLayoutViewModel(IWindowManager windowManager, DeviceLayoutEditorViewModel deviceLayoutEditorViewModel) { _windowManager = windowManager; _deviceLayoutEditorViewModel = deviceLayoutEditorViewModel; }