private void DeleteRow_Command_Executed(object sender, ExecutedRoutedEventArgs e) { Console.WriteLine("The New command was invoked"); Data_Row temp_row = (Data_Row)e.Parameter; int Index = temp_row.Index; Console.WriteLine(Index); DeleteRow(Index); }
private void button_newInput_Click(object sender, RoutedEventArgs e) { Console.WriteLine("new row"); Data_Row newRow = new Data_Row(); newRow.Index = Rows.Count; newRow.Path_String = string.Empty; newRow.Extra_Text = string.Empty; Rows.Add(newRow); lvDataBinding.ItemsSource = Rows; }
public MainWindow() { InitializeComponent(); Rows = new ObservableCollection <Data_Row>(); if (Utilities.DoesFolderExist("Data")) { if (Utilities.DoesFileExist("Saved_Paths.txt", "Data")) { //Load Config List <string> temp_list_Path = new List <string>(); List <string> temp_list_Extra = new List <string>(); Utilities.MakeFolder("Data"); string[] path_array = Utilities.LoadLinesFromFile("Saved_Paths.txt", "Data"); string[] extra_array = Utilities.LoadLinesFromFile("Saved_Extra.txt", "Data"); int i = 0; foreach (string path in path_array) { Data_Row new_row = new Data_Row(); new_row.Path_String = path_array[i]; new_row.Extra_Text = extra_array[i]; new_row.Index = i; Rows.Add(new_row); i += 1; } } } else { for (int i = 0; i < 1; i++) { Data_Row newRow = new Data_Row(); newRow.Index = Rows.Count; newRow.Path_String = string.Empty; newRow.Extra_Text = string.Empty; Rows.Add(newRow); } } lvDataBinding.ItemsSource = Rows; Work_Thread.IsBackground = true; Work_Thread.Start(); }