示例#1
0
        private static void OnSelectedItemPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EditedCombobox control = (EditedCombobox)sender;
            DicDataModel   model   = (DicDataModel)e.NewValue;

            control.ChangeSelectedItem(model);
        }
示例#2
0
 public void AddOrder(int count, string msg)
 {
     try
     {
         var model = new DicDataModel {
             ID = count, Data = msg
         };
         TCPConnection.Instance.SendData("FB" + JsonConvert.SerializeObject(model));
     }
     catch { }
 }
示例#3
0
 public void SendMessage(int id, string message)
 {
     try
     {
         var model = new DicDataModel {
             ID = id, Data = message
         };
         TCPConnection.Instance.SendData("FA" + JsonConvert.SerializeObject(model));
     }
     catch { }
 }
示例#4
0
 private void cbxData_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbxData.SelectedIndex < 0)
     {
         txtDefault.Visibility = Visibility.Visible;
         txtData.Text          = "";
     }
     else
     {
         txtDefault.Visibility = Visibility.Collapsed;
         txtData.Text          = cbxData.SelectedItem.ToString();
         if (cbxData.SelectedIndex < Items.Count())
         {
             SelectedItem = Items[cbxData.SelectedIndex];
         }
     }
 }
示例#5
0
 private void ChangeSelectedItem(DicDataModel model)
 {
     txtData.Visibility    = Visibility.Visible;
     txtDefault.Visibility = Visibility.Collapsed;
     txtData.Text          = model.Data;
 }