mirror of
https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition.git
synced 2026-06-20 12:23:09 +00:00
Add chapter 10 sample project
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface IActivationService
|
||||
{
|
||||
Task ActivateAsync(object activationArgs);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface ILocalSettingsService
|
||||
{
|
||||
Task<T?> ReadSettingAsync<T>(string key);
|
||||
|
||||
Task SaveSettingAsync<T>(string key, T value);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface INavigationService
|
||||
{
|
||||
event NavigatedEventHandler Navigated;
|
||||
|
||||
bool CanGoBack
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
Frame? Frame
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false);
|
||||
|
||||
bool GoBack();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface INavigationViewService
|
||||
{
|
||||
IList<object>? MenuItems
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
object? SettingsItem
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
void Initialize(NavigationView navigationView);
|
||||
|
||||
void UnregisterEvents();
|
||||
|
||||
NavigationViewItem? GetSelectedItem(Type pageType);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface IPageService
|
||||
{
|
||||
Type GetPageType(string key);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface IThemeSelectorService
|
||||
{
|
||||
ElementTheme Theme
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
Task InitializeAsync();
|
||||
|
||||
Task SetThemeAsync(ElementTheme theme);
|
||||
|
||||
Task SetRequestedThemeAsync();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
|
||||
namespace TemplateStudioSampleApp.Contracts.Services;
|
||||
|
||||
public interface IWebViewService
|
||||
{
|
||||
Uri? Source
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
bool CanGoBack
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
bool CanGoForward
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
event EventHandler<CoreWebView2WebErrorStatus>? NavigationCompleted;
|
||||
|
||||
void Initialize(WebView2 webView);
|
||||
|
||||
void GoBack();
|
||||
|
||||
void GoForward();
|
||||
|
||||
void Reload();
|
||||
|
||||
void UnregisterEvents();
|
||||
}
|
||||
Reference in New Issue
Block a user