I have a ProgressRing
that I need to show while a list is loaded into a DataGrid
. When I run the app, the data is loaded, but ProgressRing
isn't showed. What am I doing wrong?
XAML:
<Grid>
<ProgressRing x:Name="CarregamentoDeContas" />
<controls:DataGrid
x:Name="DataGridDeContas"
AutoGenerateColumns="True"
ItemsSource="{x:Bind Contas}" />
</Grid>
code-behind:
private List<Conta> Contas;
private void ObterListaDeContas()
{
try
{
CarregamentoDeContas.IsActive = true;
Contas = ListaDeContas.ObterContas();
}
finally
{
CarregamentoDeContas.IsActive = false;
}
}
public ContasPage()
{
this.InitializeComponent();
ObterListaDeContas();
}