You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Signal_Generator
{
/// <summary>
/// Логика взаимодействия для AddSignalWindow.xaml
/// </summary>
public partial class AddSignalWindow : Window
{
ObservableCollection<Parameter> signalProps = new ObservableCollection<Parameter>();
ObservableCollection<IAnalogSignal> typesOfSignal = new ObservableCollection<IAnalogSignal>();
public AddSignalWindow()
{
InitializeComponent();
typesOfSignal.Add(new SinusoidalSignal(0, 0));
typesOfSignal.Add(new FmSignal(0, 0, 0));
signalType_ComboBox.ItemsSource = typesOfSignal;
signalProps_DataGrid.ItemsSource = signalProps;
}
private void signalType_ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
signalProps.Clear();
var dict = ((IAnalogSignal)signalType_ComboBox.SelectedItem).paramsCollection as Collection<Parameter>;
foreach (Parameter p in dict)
signalProps.Add(p);
}
}
}