예제 #1
0
 private void ViewModel_HandleCompleted(object sender, EntityEventArgs e)
 {
     if(this.HandleCompleted != null)
     {
         this.HandleCompleted(this, e);
     }
     this.Close();
 }
 private void AddOrUpdate_HandleCompleted(object sender, EntityEventArgs e)
 {
     SKUEncodeModel model = e.Entity as SKUEncodeModel;
     if (e.IsAdd)
     {
         this.ItemsSource.Add(model);
     }
     else
     {
         SKUEncodeModel item = this.ItemsSource.Where(x => x.ID == model.ID).First();
         int index = this.ItemsSource.IndexOf(item);
         this.ItemsSource[index] = model;
     }
     this.SelectedItem = model;
 }
예제 #3
0
 /// <summary>
 /// 修改完毕事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AddOrUpdate_HandleCompleted(object sender, EntityEventArgs e)
 {
     SKUCGYModel model = e.Entity as SKUCGYModel;
     if (e.IsAdd)
     {
         this.ItemsSource.Add(model);
     }
     else
     {
         SKUCGYModel item = this.ItemsSource.Where(x => x.ID == model.ID).First();
         int index = this.ItemsSource.IndexOf(item);
         this.ItemsSource[index] = model;
     }
     this.SelectedItem = model;
     ApplicationContext.EventAggregator.GetEvent<OneChangedEvent>().Publish(model.Entity);
 }