private void LoadSignalView(XmlElement viewNode) { XmlAttribute attr = viewNode.Attributes["Source"]; if (attr == null) { return; } Guid sourceGuid = XmlConvert.ToGuid(attr.Value); IDataSource dataSource = Root.DataSources.FirstOrDefault(s => s.UniqueIdentifier == sourceGuid); if (dataSource == null) { return; } attr = viewNode.Attributes["ComponentIndex"]; if (attr == null) { return; } int componentIndex; if (int.TryParse(attr.Value, out componentIndex) == false) { return; } SetWorkingSignalView(dataSource, componentIndex); SignalViewSelector.SelectedDataSource = SignalViewSelector.AvailableDataSources.FirstOrDefault(vm => vm.DataSource.UniqueIdentifier == sourceGuid); if (SignalViewSelector.SelectedDataSource != null) { SignalViewSelector.SelectedDataSource.SelectedComponentIndex = componentIndex; } SignalView.LoadLayout(viewNode); }