示例#1
0
        public async Task Remove(CancellationToken ct, INavigationHistoryEntry entry)
        {
            await _remove(ct, entry);

            _entries.Remove(entry);
            _viewModels.Remove(entry.Request);
        }
示例#2
0
 private async Task RemoveHistoryEntry(CancellationToken ct, INavigationHistoryEntry arg)
 {
     if (arg.IsAlive)
     {
         var aliveEntry = (AliveNavigationHistoryEntry)arg;
         await ThreadPool.RunAsync(operation => _viewModelFactory.ReleaseViewModel(aliveEntry.ViewModel), WorkItemPriority.Low);
     }
 }
示例#3
0
        private async Task NavigateBackWithNotAliveRequest(CancellationToken ct, INavigationHistoryEntry previousEntry)
        {
            //entries has no navigation page created so we navigate to the page and remove
            var last = _history.Entries.Last();

            await Navigate(ct, previousEntry.Request);

            await _dispatcherScheduler.Run(() => _frame.RemoveBackEntry());

            //removes the previous entry which was not alive
            await _history.Remove(ct, previousEntry);

            //removes the last entry which was the page where the back navigation was made
            await _history.Remove(ct, last);
        }
示例#4
0
		public async Task Remove(CancellationToken ct, INavigationHistoryEntry entry)
		{
			await _remove(ct, entry);
			_entries.Remove(entry);
			_viewModels.Remove(entry.Request);
		}
示例#5
0
		private async Task RemoveHistoryEntry(CancellationToken ct, INavigationHistoryEntry arg)
		{
			if (arg.IsAlive)
			{
				var aliveEntry = (AliveNavigationHistoryEntry)arg;
				await ThreadPool.RunAsync(operation => _viewModelFactory.ReleaseViewModel(aliveEntry.ViewModel), WorkItemPriority.Low);
			}
		}
示例#6
0
		private async Task NavigateBackWithNotAliveRequest(CancellationToken ct, INavigationHistoryEntry previousEntry)
		{
			//entries has no navigation page created so we navigate to the page and remove 
			var last = _history.Entries.Last();
			await Navigate(ct, previousEntry.Request);
			await _dispatcherScheduler.Run(() => _frame.RemoveBackEntry());
			//removes the previous entry which was not alive
			await _history.Remove(ct, previousEntry);
			//removes the last entry which was the page where the back navigation was made
			await _history.Remove(ct, last);
		}