.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,513 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I'm doing the UI operation, I want to display the busy indicator, I had added in the below way.
try
{
var expander = sender as Expander;
var headerText = (expander.Header as Border)?.Content is StackLayout headerStackLayout
? (headerStackLayout.Children[0] as Grid)?.Children[0] is StackLayout headerGridStackLayout
? (headerGridStackLayout.Children[0] as Label)?.Text
: null
: null;
if (string.IsNullOrEmpty(headerText) || !e.IsExpanded || expander.Content != null)
return;
foreach (var item in mExpanders)
{
mBindingContextVM.IsBusy = true;
await Task.Yield();
var headerLabelText = (item.Value.Header as Border)?.Content is StackLayout headerStack
? (headerStack.Children[0] as Grid)?.Children[0] is StackLayout headerGrid
? (headerGrid.Children[0] as Label)?.Text
: null
: null;
if (headerText == headerLabelText)
{
var content = AddChildren(item.Key);
expander.Content = content;
}
mBindingContextVM.IsBusy = false;
await Task.Yield();
}
}
catch (Exception ex)
{
mBindingContextVM.IsBusy = false;
await Task.Yield();
App.TCOAppDiagnosticsService.ReportException(ex);
}
The above piece of code is working for the android and iOS, unfortunately it is not working with the windows.
FYI - in the AddChildren() function, I'm adding data to the particular expander.
Thanks
Vaibhav Methuku