The desired scenario:
When I click on the button, I want it to be hidden until async call is completed.
I have a button in xaml like this
<Button Name="btnLoadNextTransactions" Content="Button" Click="btnLoadNextTransactions_Click" Visibility="{Binding LoadMore, Converter={StaticResource converter}}" />
and a click event to
private void btnLoadNextTransactions_Click(object sender, RoutedEventArgs e)
{
App.ViewModel.LoadMore = false;
ApplicationBl<Transaction>.GetDataLoadingCompleted += GetDataLoadingCompleted;
ApplicationBl<Transaction>.GetData(++offset*10, 10);//works only if I comment out this line
App.ViewModel.LoadMore = true;
}
This only works if I comment out async call
//ApplicationBl<Transaction>.GetData(++offset*10, 10);
But that’s not a feature I want to comment out 🙂
I know I’m missing some delagete or dispatcher. I just started coding with SL.
You need to put LoadMore = true in the GetDataLoadingCompleted method.