public LinePlotConfig Clone() { LinePlotConfig linePlotConfig = new LinePlotConfig { Name = Name, Appearance = Appearance.Clone() }; linePlotConfig.SeriesConfigs = (from config in SeriesConfigs select config.Clone()).ToList(); return(linePlotConfig); }
public LinePlotConfigEditWindow(LinePlotConfig config) { InitializeComponent(); editorVM = new LinePlotConfigEditorVM(config); DataContext = editorVM; ConfigItemsContainer.ItemsSource = editorVM.SeriesConfigListItems; string[] comboItemStrings = new string[] { PMUMeasOption, ScadaMeasOption, PspMeasOption, RandomTimeSeriesMeasOption, RandomMeasOption }; MeasOptionComboBox.ItemsSource = comboItemStrings; MeasOptionComboBox.SelectedIndex = 0; }
public void SetState(IWidgetState state) { if (state is OxyPlotWidgetState widgetState) { if (widgetState.PlotConfig is LinePlotConfig plotConfig) { mLinePlotConfig = plotConfig; SetupPlotView(); } else { Console.WriteLine("Inflation rejected since non LinePlotConfig given for inflation..."); } } else { Console.WriteLine("Inflation rejected since non OxyPlotWidgetState given for inflation..."); } }
// constructor public LinePlotConfigEditorVM(LinePlotConfig config) { mLinePlotConfig = config.Clone(); SeriesConfigListItems = new ObservableCollection <SeriesConfigListItem>(); SyncSeriesConfigListItemsWithConfig(); }