Ejemplo n.º 1
0
		private static DeviceViewModel AddDeviceInternal(Device device, TreeItemViewModel<DeviceViewModel> parentDeviceViewModel)
		{
			var deviceViewModel = new DeviceViewModel(device);
			if (parentDeviceViewModel != null)
				parentDeviceViewModel.Children.Add(deviceViewModel);

			foreach (var childDevice in device.Children)
				AddDeviceInternal(childDevice, deviceViewModel);
			return deviceViewModel;
		}
Ejemplo n.º 2
0
		private TreeViewItem BringTreeViewItemIntoView(TreeItemViewModel item)
		{
			if (item == null)
				return null;
			ItemsControl parentContainer = (ItemsControl)BringTreeViewItemIntoView(item.TreeParent) ?? this;
			return BringItemIntoView(parentContainer, item);
		}