Update NavigationController.cs
- Adding PopToRootAsync method - small comment change
This commit is contained in:
parent
00440a50e8
commit
6f005114bc
@ -22,7 +22,7 @@ namespace TelegramBotBase.Form.Navigation
|
|||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will replace the controller when poping a form with last last remaining form.
|
/// Will replace the controller when poping a form to the root form.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SaveState]
|
[SaveState]
|
||||||
public bool ForceCleanupOnLastPop { get; set; }
|
public bool ForceCleanupOnLastPop { get; set; }
|
||||||
@ -115,6 +115,21 @@ namespace TelegramBotBase.Form.Navigation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pop's through all forms back to the root form.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public virtual async Task PopToRootAsync()
|
||||||
|
{
|
||||||
|
if (Index == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while (History.Count > 1)
|
||||||
|
{
|
||||||
|
await PopAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Pushing the given form to the stack and renders it.
|
/// Pushing the given form to the stack and renders it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user