-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from character-map-uwp/Nov-23
Nov 23
- Loading branch information
Showing
209 changed files
with
41,229 additions
and
35,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,3 +222,4 @@ ModelManifest.xml | |
*.appx | ||
CharacterMap/CharacterMap.CX/Generated Files | ||
CharacterMap/enc_temp_folder | ||
lfs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 18 additions & 21 deletions
39
CharacterMap/CharacterMap/Activation/ActivationHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
using System.Threading.Tasks; | ||
namespace CharacterMap.Activation; | ||
|
||
namespace CharacterMap.Activation | ||
public abstract class ActivationHandler | ||
{ | ||
public abstract class ActivationHandler | ||
public abstract bool CanHandle(object args); | ||
public abstract Task HandleAsync(object args); | ||
} | ||
|
||
public abstract class ActivationHandler<T> : ActivationHandler where T : class | ||
{ | ||
protected abstract Task HandleInternalAsync(T args); | ||
|
||
public override async Task HandleAsync(object args) | ||
{ | ||
public abstract bool CanHandle(object args); | ||
public abstract Task HandleAsync(object args); | ||
await HandleInternalAsync(args as T); | ||
} | ||
|
||
public abstract class ActivationHandler<T> : ActivationHandler where T : class | ||
public override bool CanHandle(object args) | ||
{ | ||
protected abstract Task HandleInternalAsync(T args); | ||
|
||
public override async Task HandleAsync(object args) | ||
{ | ||
await HandleInternalAsync(args as T); | ||
} | ||
|
||
public override bool CanHandle(object args) | ||
{ | ||
return args is T && CanHandleInternal(args as T); | ||
} | ||
return args is T && CanHandleInternal(args as T); | ||
} | ||
|
||
protected virtual bool CanHandleInternal(T args) | ||
{ | ||
return true; | ||
} | ||
protected virtual bool CanHandleInternal(T args) | ||
{ | ||
return true; | ||
} | ||
} |
53 changes: 24 additions & 29 deletions
53
CharacterMap/CharacterMap/Activation/DefaultLaunchActivationHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using CharacterMap.Services; | ||
using CommunityToolkit.Mvvm.DependencyInjection; | ||
using Windows.ApplicationModel.Activation; | ||
|
||
namespace CharacterMap.Activation | ||
namespace CharacterMap.Activation; | ||
|
||
internal class DefaultLaunchActivationHandler : ActivationHandler<ILaunchActivatedEventArgs> | ||
{ | ||
internal class DefaultLaunchActivationHandler : ActivationHandler<ILaunchActivatedEventArgs> | ||
private readonly string _navElement; | ||
|
||
private NavigationServiceEx NavigationService => Ioc.Default.GetService<NavigationServiceEx>(); | ||
|
||
public DefaultLaunchActivationHandler(Type navElement) | ||
{ | ||
private readonly string _navElement; | ||
|
||
private NavigationServiceEx NavigationService => Ioc.Default.GetService<NavigationServiceEx>(); | ||
_navElement = navElement.FullName; | ||
} | ||
|
||
public DefaultLaunchActivationHandler(Type navElement) | ||
{ | ||
_navElement = navElement.FullName; | ||
} | ||
|
||
protected override async Task HandleInternalAsync(ILaunchActivatedEventArgs args) | ||
{ | ||
// When the navigation stack isn't restored navigate to the first page, | ||
// configuring the new page by passing required information as a navigation | ||
// parameter | ||
NavigationService.Navigate(_navElement, args.Arguments); | ||
protected override async Task HandleInternalAsync(ILaunchActivatedEventArgs args) | ||
{ | ||
// When the navigation stack isn't restored navigate to the first page, | ||
// configuring the new page by passing required information as a navigation | ||
// parameter | ||
NavigationService.Navigate(_navElement, args.Arguments); | ||
|
||
// You can use this sample to create toast notifications where needed in your app. | ||
// Singleton<ToastNotificationsService>.Instance.ShowSavedNotification(); | ||
await Task.CompletedTask; | ||
} | ||
// You can use this sample to create toast notifications where needed in your app. | ||
// Singleton<ToastNotificationsService>.Instance.ShowSavedNotification(); | ||
await Task.CompletedTask; | ||
} | ||
|
||
protected override bool CanHandleInternal(ILaunchActivatedEventArgs args) | ||
{ | ||
// None of the ActivationHandlers has handled the app activation | ||
return NavigationService.Frame.Content == null; | ||
} | ||
protected override bool CanHandleInternal(ILaunchActivatedEventArgs args) | ||
{ | ||
// None of the ActivationHandlers has handled the app activation | ||
return NavigationService.Frame.Content == null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.