diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-23 09:45:01 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-23 09:45:01 +0300 |
| commit | 2c8da378c82e5181f0566a564de529ab7ef96f4f (patch) | |
| tree | d450472402b15fc30d8bd482da348826caf487c5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs | |
| parent | 774da535e732ecd5a3737550ef1d35819a1e7fc6 (diff) | |
| download | Tango-2c8da378c82e5181f0566a564de529ab7ef96f4f.tar.gz Tango-2c8da378c82e5181f0566a564de529ab7ef96f4f.zip | |
Improvements to machine studio view models and navigation system.
Improvements to tech board selection and edit modes handling.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs | 98 |
1 files changed, 96 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs index 4d1cbea8c..e20940c8d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.Commands; namespace Tango.MachineStudio.Common.Navigation { @@ -12,9 +13,102 @@ namespace Tango.MachineStudio.Common.Navigation public interface INavigationManager { /// <summary> - /// Navigates to the specified view. + /// Gets the current module. + /// </summary> + IStudioModule CurrentModule { get; } + + /// <summary> + /// Gets the current view model. + /// </summary> + StudioViewModel CurrentVM { get; } + + /// <summary> + /// Gets a value indicating whether the navigation system is able to navigate to the previous view. + /// </summary> + bool CanNavigateBack { get; } + + /// <summary> + /// Navigates to the previous view if <see cref="CanNavigateBack"/> is true. + /// </summary> + Task<bool> NavigateBack(); + + /// <summary> + /// Navigates to the previous view.. + /// </summary> + RelayCommand NavigateBackCommand { get; } + + /// <summary> + /// Navigates to the specified full path in command parameter. + /// </summary> + RelayCommand<String> NavigateToCommand { get; } + + /// <summary> + /// Navigates to the specified PPC view. /// </summary> /// <param name="view">The view.</param> - void NavigateTo(NavigationView view); + Task<bool> NavigateTo(NavigationView view, bool pushToHistory = true); + + /// <summary> + /// Navigates to the specified PPC view with the specified receive object. + /// </summary> + /// <param name="view">The view.</param> + Task<bool> NavigateWithObject<TPass>(NavigationView view, TPass obj, bool pushToHistory = true); + + /// <summary> + /// Navigates to the specified module. + /// </summary> + /// <typeparam name="T"></typeparam> + Task<bool> NavigateTo<T>(bool pushToHistory = true) where T : IStudioModule; + + /// <summary> + /// Navigates to the specified module using the view path (e.g MainView.JobsView). + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="viewPath">The view path.</param> + Task<bool> NavigateTo<T>(String viewPath, bool pushToHistory = true) where T : IStudioModule; + + /// <summary> + /// Navigates to the specified module using the view path (e.g MainView,JobsView). + /// This method makes it easy to do stuff like NavigateTo(nameof(MainView),nameof(JobsView)); + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="viewPath">The view path.</param> + Task<bool> NavigateTo<T>(bool pushToHistory = true, params String[] viewPath) where T : IStudioModule; + + /// <summary> + /// Navigates to the specified module and view by full path (e.g Jobs.JobsView). + /// </summary> + /// <param name="fullPath">The full path.</param> + Task<bool> NavigateTo(String fullPath, bool pushToHistory = true); + + /// <summary> + /// Navigates to the specified module and view with the specified object and expecting a return parameter. + /// The view must be of type INavigationResultProvider<TResult>. + /// </summary> + /// <param name="fullPath">The full path.</param> + Task<TResult> NavigateForResult<TModule, TView, TResult, TPass>(TPass obj, bool pushToHistory = true) + where TModule : IStudioModule; + + /// <summary> + /// Navigates to the specified module and view with the specified object. + /// </summary> + /// <typeparam name="TModule">The type of the module.</typeparam> + /// <typeparam name="TView">The type of the view.</typeparam> + /// <typeparam name="TPass">The type of the pass.</typeparam> + /// <param name="obj">The object.</param> + /// <param name="pushToHistory">if set to <c>true</c> [push to history].</param> + /// <returns></returns> + Task<bool> NavigateWithObject<TModule, TView, TPass>(TPass obj, bool pushToHistory = true) + where TModule : IStudioModule; + + /// <summary> + /// Clears the navigation back history. + /// </summary> + void ClearHistory(); + + /// <summary> + /// Clears the navigation back history except the specified view type. + /// </summary> + void ClearHistoryExcept<T>(); } } |
