Example #1
0
		void Initialize()
		{
			Lines = new ObservableRangeCollection<LineViewModel>();
			foreach (var line in Configuration.Lines)
			{
				var lineViewModel = new LineViewModel(line);
				Lines.Add(lineViewModel);
			}
            RenameLines();
			SelectedLine = Lines.FirstOrDefault();
		}
Example #2
0
        public DeviceViewModel(Device device, LineViewModel owner)
		{
			Device = device;
            Owner = owner;
            _cableType = Device.Cable.CableType;
			_cableResistivity = Device.Cable.Resistivity;
			_cableLength = Device.Cable.Length;

            Drivers = new ObservableCollection<DriverViewModel>(DriversHelper.Drivers.Where(x => x.CanAdd).Select(x => new DriverViewModel(x)));
            _selectedDriver = Drivers.FirstOrDefault(x => x.Driver.DriverType == Device.DriverType);
		}
Example #3
0
		void OnAddLine()
		{
			var line = new Line();
            
			Configuration.Lines.Add(line);
			var lineViewModel = new LineViewModel(line);
			Lines.Add(lineViewModel);
            RenameLines(Lines.Count - 1);
			SelectedLine = lineViewModel;
		}