Merge pull request #2855 from andrechi1/develop
Implement MvxWindowsPage.ClearBackStack
This commit is contained in:
Коммит
3d831466ff
|
@ -1,15 +1,17 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using System.Linq;
|
||||
using MvvmCross.Platforms.Uap.Views.Suspension;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.Views;
|
||||
using Windows.UI.Core;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
namespace MvvmCross.Platforms.Uap.Views
|
||||
{
|
||||
|
@ -66,14 +68,21 @@ namespace MvvmCross.Platforms.Uap.Views
|
|||
}
|
||||
}
|
||||
|
||||
public void ClearBackStack()
|
||||
public virtual void ClearBackStack()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
/*
|
||||
// note - we do *not* use CanGoBack here - as that seems to always returns true!
|
||||
while (NavigationService.BackStack.Any())
|
||||
NavigationService.RemoveBackEntry();
|
||||
*/
|
||||
var backStack = base.Frame?.BackStack;
|
||||
|
||||
while (backStack?.Any())
|
||||
{
|
||||
backStack.RemoveAt(0);
|
||||
}
|
||||
|
||||
UpdateBackButtonVisibility();
|
||||
}
|
||||
|
||||
protected virtual void UpdateBackButtonVisibility()
|
||||
{
|
||||
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
|
||||
}
|
||||
|
||||
private string _reqData = string.Empty;
|
||||
|
|
Загрузка…
Ссылка в новой задаче