Example #1
0
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            var setting = this.NewVideoSetting();
            VideoSettingEditDialog dialog = new VideoSettingEditDialog();

            dialog.EditVideoSetting(setting, this.Places);
            if (dialog.ShowDialog(this) == true)
            {
                (this.dataGridVideoSetting.ItemsSource as ObservableCollection <VideoSetting>).Add(setting);
            }
        }
Example #2
0
 private void dataGridRowVideoSetting_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left)
     {
         DataGridRow dgr = DataGridRow.GetRowContainingElement(e.OriginalSource as FrameworkElement);
         if (dgr != null)
         {
             var setting = dgr.DataContext as VideoSetting;
             if (setting != null)
             {
                 VideoSettingEditDialog dialog = new VideoSettingEditDialog();
                 dialog.EditVideoSetting(setting, this.Places);
                 dialog.ShowDialog(this);
             }
         }
     }
 }