public MainWindow() { InitializeComponent(); Rxdata = new MidiData(); TxData = new MidiData(); SetGraph(); Binding binding = new Binding("FrameMsg"); binding.Source = Rxdata; //myBinding.Mode = BindingMode.TwoWay; /////myBinding.ElementName = "FrameMsg"; //// Bind the new data source to the myText TextBlock control's Text dependency property. txtRxDataReal.SetBinding(TextBox.TextProperty, binding); //binding Txdata binding = new Binding("TxString"); binding.Source = TxData; txtTxData.SetBinding(TextBox.TextProperty, binding); //SerialPort comboBoxBaud.Items.Clear(); comboBoxBaud.Items.Add("9600"); comboBoxBaud.Items.Add("19200"); comboBoxBaud.Items.Add("38400"); comboBoxBaud.Items.Add("57600"); comboBoxBaud.Items.Add("115200"); comboBoxBaud.Items.Add("921600"); comboBoxBaud.SelectedItem = comboBoxBaud.Items[2]; }
public MainWindow() { BSendTemp[0] = 0x96; BSendTemp[1] = 0x00; BSendTemp[2] = 0x00; //BSendTemp = { 0x96,0x00,0x00} //这个Rx是midi传过来的值 InitializeComponent(); Rxdata = new MidiData(); Binding myBinding = new Binding("FrameMsg"); myBinding.Source = Rxdata; //myBinding.Mode = BindingMode.TwoWay; /////myBinding.ElementName = "FrameMsg"; //// Bind the new data source to the myText TextBlock control's Text dependency property. txtRxDataReal.SetBinding(TextBox.TextProperty, myBinding); //showShine.SetBinding(TextBox.TextProperty, myTemperbinding); //showTemper.SetBinding(TextBox.TextProperty, myLightBinding); //temperData = new Temperature(); //Binding bind = new Binding(); //bind.Source = comboBoxBaud.Items.Clear(); comboBoxBaud.Items.Add("9600"); comboBoxBaud.Items.Add("19200"); comboBoxBaud.Items.Add("38400"); comboBoxBaud.Items.Add("57600"); comboBoxBaud.Items.Add("115200"); comboBoxBaud.Items.Add("921600"); comboBoxBaud.SelectedItem = comboBoxBaud.Items[2]; initChart(); }