Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            ts = FromToTableModel.GetData();
            dataGrid.ItemsSource = ts;

            // Read XML on Load
            Table.FromXML("S:\\Projects\\DataMigration\\DatabaseMetadata\\DatabaseMetadata\\bin\\Debug\\tableParents.xml");
        }
Exemplo n.º 2
0
 private void addRow(object sender, RoutedEventArgs e)
 {
     ts.Add(new FromToTableModel()
     {
         Id           = FromToTableModel.getCount(),
         FromDatabase = "",
         ToDatabase   = "",
         Status       = ""
     });
 }
Exemplo n.º 3
0
        private void removeRow(object sender, RoutedEventArgs e)
        {
            var row_id = (dataGrid.SelectedItem as FromToTableModel).Id;
            FromToTableModel rowToRemove = (from r in ts where r.Id == row_id select r).SingleOrDefault();

            ts.Remove(rowToRemove);
            FromToTableModel.decrementCount();
            var index = 1;

            foreach (var r in ts)
            {
                r.Id = index;
                index++;
            }
        }