コード例 #1
0
        private void starterDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            // search for the row on which the user performed the doubleclick
            DependencyObject dp = (DependencyObject)e.OriginalSource;

            while (dp != null && !(dp is DataGridRow))
            {
                dp = VisualTreeHelper.GetParent(dp);
            }

            // if the row is not found, the user did not perform a doublclick on a row
            if (dp is DataGridRow)
            {
                Starter starter = ((DataGridRow)dp).DataContext as Starter;
                if (starter != null)
                {
                    EditStarterWindow ed = new EditStarterWindow(starter);
                    ed.ShowDialog();
                }
            }
        }
コード例 #2
0
        public EditStarterWindow(Starter starter)
        {
            InitializeComponent();

            _starter = starter;
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Starter EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStarter(Starter starter)
 {
     base.AddObject("Starter", starter);
 }