2025-04-24 20:56:44 +08:00
|
|
|
|
using WPFluent.Abstractions;
|
2025-02-10 20:53:40 +08:00
|
|
|
|
using WPFluent.Controls;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WPFluent;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents a contract with a <see cref="System.Windows.Window"/> that contains <see cref="INavigationView"/>.
|
|
|
|
|
|
/// Through defined <see cref="INavigationViewPageProvider"/> service allows you to use the MVVM model in <c>WPF UI</c>
|
|
|
|
|
|
/// navigation.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public interface INavigationWindow
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Triggers the command to close a window.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void CloseWindow();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides direct access to the control responsible for navigation.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>Instance of the <see cref="INavigationView"/> control.</returns>
|
|
|
|
|
|
INavigationView GetNavigation();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Lets you navigate to the selected page based on it's type. Should be used with <see
|
|
|
|
|
|
/// cref="INavigationViewPageProvider"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pageType"><see langword="Type"/> of the page.</param>
|
|
|
|
|
|
/// <returns><see langword="true"/> if the operation succeeds. <see langword="false"/> otherwise.</returns>
|
|
|
|
|
|
bool Navigate(Type pageType);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Lets you attach the service that delivers page instances to <see cref="INavigationView"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="navigationViewPageProvider">Instance of the <see cref="INavigationViewPageProvider"/> with attached service provider.</param>
|
|
|
|
|
|
void SetPageService(INavigationViewPageProvider navigationViewPageProvider);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Lets you attach the service provider that delivers page instances to <see cref="INavigationView"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="serviceProvider">Instance of the <see cref="IServiceProvider"/>.</param>
|
|
|
|
|
|
void SetServiceProvider(IServiceProvider serviceProvider);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Triggers the command to open a window.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void ShowWindow();
|
|
|
|
|
|
}
|