Skip to content

Commit

Permalink
Added a repro for #77.
Browse files Browse the repository at this point in the history
  • Loading branch information
grokys committed Feb 9, 2022
1 parent e9b0566 commit 18db01c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion samples/ProControlsDemo/MainWindow.axaml.cs
Expand Up @@ -37,6 +37,7 @@ public MainWindow()

public void AddCountryClick(object sender, RoutedEventArgs e)
{
var countries = this.FindControl<TreeDataGrid>("countries");
var countryTextBox = this.FindControl<TextBox>("countryTextBox");
var regionTextBox = this.FindControl<TextBox>("regionTextBox");
var populationTextBox = this.FindControl<TextBox>("populationTextBox");
Expand All @@ -57,7 +58,12 @@ public void AddCountryClick(object sender, RoutedEventArgs e)
null,
null,
null);
((MainWindowViewModel)DataContext!).Countries.AddCountry(country);
var vm = (MainWindowViewModel)DataContext!;
vm.Countries.AddCountry(country);

var index = vm.Countries.Source.Rows.Count - 1;
countries.RowsPresenter!.BringIntoView(index);
countries.TryGetRow(index)?.Focus();
}

private void InitializeComponent()
Expand Down

0 comments on commit 18db01c

Please sign in to comment.