private void InitializeCurrentDevice() { _currentDeviceViewModel = new CurrentDeviceViewModel(); _currentDeviceView = new CurrentDeviceView(); _currentDeviceView.DataContext = _currentDeviceViewModel; elementHost.Child = _currentDeviceView; if (DeviceId != Guid.Empty) { _currentDeviceViewModel.Inicialize(DeviceId); } }
public MainWindow() { InitializeComponent(); FiresecManager.Connect("adm", ""); //DataContext = this; SelectDeviceCommand = new RelayCommand(OnSelect); ShowPropertiesCommand = new RelayCommand(OnShowProperties); _currentDeviceViewModel = new CurrentDeviceViewModel(); _currentDeviceView = new CurrentDeviceView(); //currentDeviceView.DataContext = _currentDeviceViewModel; _currentDeviceViewModel.SelectDevice(); DataContext = CurrentDeviceViewModel; //_mainCurrentDeviceView.DataContext = CurrentDeviceViewModel; // currentDeviceView = _currentDeviceViewModel; }
public void InitializeCurrentDevice() { _currentDeviceViewModel = new CurrentDeviceViewModel(); _currentDeviceView = new CurrentDeviceView(); _currentDeviceView.DataContext = _currentDeviceViewModel; if (DeviceId != Guid.Empty) { _currentDeviceViewModel.Inicialize(DeviceId); } }