Я хочу, чтобы при переходе на страницу отображался ProgressRing.
Я попытался установить его следующим образом:
MainWindow.xaml.cs:
Код: Выделить всё
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
var root = this.Content as FrameworkElement;
if (root != null)
root.Loaded += async (s, e) => await DisplayDialog();
prgr.IsActive = false;
}
private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
{
var item = sender.MenuItems.OfType().First(x => (string)x.Content == (string)args.InvokedItem);
Navigate(item);
prgr.IsActive = false;
}
private void Navigate(NavigationViewItem item)
{
prgr.IsActive = true;
try
{
switch (item.Tag)
{
case "tabellenView":
ContentFrame.Navigate(typeof(TabellenView), null, new DrillInNavigationTransitionInfo());
break;
case "sqlScriptsView":
ContentFrame.Navigate(typeof(SqlScriptsView), null, new DrillInNavigationTransitionInfo());
break;
}
}
catch (Exception e)
{
SentrySdk.CaptureException(e);
}
}
private async Task DisplayDialog()
{
await contentDialog.ShowAsync();
}
private void contentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
if (!DatabaseConnectionService.IsConnected)
{
args.Cancel = true;
}
}
}
Код: Выделить всё
Можете ли вы мне помочь?
Подробнее здесь: https://stackoverflow.com/questions/782 ... mainwindow