44 changed files with 1321 additions and 38 deletions
@ -0,0 +1,14 @@ |
|||
<?xml version = "1.0" encoding = "UTF-8" ?> |
|||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
|||
xmlns:local="clr-namespace:OpenIddict.Sandbox.Maui.Client" |
|||
x:Class="OpenIddict.Sandbox.Maui.Client.App"> |
|||
<Application.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" /> |
|||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</Application.Resources> |
|||
</Application> |
|||
@ -0,0 +1,13 @@ |
|||
#if IOS || WINDOWS
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public partial class App : Application |
|||
{ |
|||
public App() |
|||
{ |
|||
InitializeComponent(); |
|||
|
|||
MainPage = new AppShell(); |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<Shell |
|||
x:Class="OpenIddict.Sandbox.Maui.Client.AppShell" |
|||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
|||
xmlns:local="clr-namespace:OpenIddict.Sandbox.Maui.Client" |
|||
Shell.FlyoutBehavior="Disabled"> |
|||
|
|||
<ShellContent |
|||
Title="Home" |
|||
ContentTemplate="{DataTemplate local:MainPage}" |
|||
Route="MainPage" /> |
|||
|
|||
</Shell> |
|||
@ -0,0 +1,8 @@ |
|||
#if IOS || WINDOWS
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public partial class AppShell : Shell |
|||
{ |
|||
public AppShell() => InitializeComponent(); |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,62 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
|||
x:Class="OpenIddict.Sandbox.Maui.Client.MainPage"> |
|||
|
|||
<ScrollView> |
|||
<VerticalStackLayout |
|||
Spacing="25" |
|||
Padding="30,0" |
|||
VerticalOptions="Center"> |
|||
|
|||
<Image |
|||
Source="dotnet_bot.png" |
|||
SemanticProperties.Description="Cute dot net bot waving hi to you!" |
|||
HeightRequest="200" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Label |
|||
Text="Hello, World!" |
|||
SemanticProperties.HeadingLevel="Level1" |
|||
FontSize="32" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Label |
|||
Text="Welcome to .NET Multi-platform App UI" |
|||
SemanticProperties.HeadingLevel="Level2" |
|||
SemanticProperties.Description="Welcome to dot net Multi platform App U I" |
|||
FontSize="18" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Button |
|||
x:Name="LocalLogin" |
|||
Text="Log in using the local server" |
|||
SemanticProperties.Hint="Starts a new authentication flow" |
|||
Clicked="OnLocalLoginButtonClicked" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Button |
|||
x:Name="LocalLoginWithGitHub" |
|||
Text="Log in using the local server (preferred service: GitHub)" |
|||
SemanticProperties.Hint="Starts a new authentication flow" |
|||
Clicked="OnLocalLoginWithGitHubButtonClicked" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Button |
|||
x:Name="TwitterLogin" |
|||
Text="Log in using Twitter" |
|||
SemanticProperties.Hint="Starts a new authentication flow" |
|||
Clicked="OnTwitterLoginButtonClicked" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
<Button |
|||
x:Name="LocalLogout" |
|||
Text="Log out from the local server" |
|||
SemanticProperties.Hint="Starts a new logout flow" |
|||
Clicked="OnLocalLogoutButtonClicked" |
|||
HorizontalOptions="Center" /> |
|||
|
|||
</VerticalStackLayout> |
|||
</ScrollView> |
|||
|
|||
</ContentPage> |
|||
@ -0,0 +1,149 @@ |
|||
#if IOS || WINDOWS
|
|||
using OpenIddict.Abstractions; |
|||
using OpenIddict.Client; |
|||
using static OpenIddict.Abstractions.OpenIddictConstants; |
|||
using static OpenIddict.Abstractions.OpenIddictExceptions; |
|||
using static OpenIddict.Client.WebIntegration.OpenIddictClientWebIntegrationConstants; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public partial class MainPage : ContentPage |
|||
{ |
|||
private readonly OpenIddictClientService _service; |
|||
|
|||
public MainPage(OpenIddictClientService service) |
|||
{ |
|||
_service = service ?? throw new ArgumentNullException(nameof(service)); |
|||
|
|||
InitializeComponent(); |
|||
} |
|||
|
|||
private async void OnLocalLoginButtonClicked(object sender, EventArgs e) |
|||
=> await LogInAsync("Local"); |
|||
|
|||
private async void OnLocalLoginWithGitHubButtonClicked(object sender, EventArgs e) |
|||
=> await LogInAsync("Local", new() |
|||
{ |
|||
[Parameters.IdentityProvider] = Providers.GitHub |
|||
}); |
|||
|
|||
private async void OnLocalLogoutButtonClicked(object sender, EventArgs e) |
|||
=> await LogOutAsync("Local"); |
|||
|
|||
private async void OnTwitterLoginButtonClicked(object sender, EventArgs e) |
|||
=> await LogInAsync(Providers.Twitter); |
|||
|
|||
private async Task LogInAsync(string provider, Dictionary<string, OpenIddictParameter>? parameters = null) |
|||
{ |
|||
// Disable the buttons to prevent concurrent operations.
|
|||
LocalLogin.IsEnabled = false; |
|||
LocalLoginWithGitHub.IsEnabled = false; |
|||
LocalLogout.IsEnabled = false; |
|||
TwitterLogin.IsEnabled = false; |
|||
|
|||
try |
|||
{ |
|||
using var source = new CancellationTokenSource(delay: TimeSpan.FromSeconds(90)); |
|||
|
|||
try |
|||
{ |
|||
// Ask OpenIddict to initiate the authentication flow (typically, by starting the system browser).
|
|||
var result = await _service.ChallengeInteractivelyAsync(new() |
|||
{ |
|||
AdditionalAuthorizationRequestParameters = parameters, |
|||
CancellationToken = source.Token, |
|||
ProviderName = provider |
|||
}); |
|||
|
|||
// Wait for the user to complete the authorization process.
|
|||
var principal = (await _service.AuthenticateInteractivelyAsync(new() |
|||
{ |
|||
Nonce = result.Nonce |
|||
})).Principal; |
|||
|
|||
await DisplayAlert("Authentication successful", $"Welcome, {principal.FindFirst(Claims.Name)!.Value}.", "OK"); |
|||
} |
|||
|
|||
catch (OperationCanceledException) |
|||
{ |
|||
await DisplayAlert("Authentication timed out", "The authentication process was aborted.", "OK"); |
|||
} |
|||
|
|||
catch (ProtocolException exception) when (exception.Error is Errors.AccessDenied) |
|||
{ |
|||
await DisplayAlert("Authorization denied", "The authorization was denied by the end user.", "OK"); |
|||
} |
|||
|
|||
catch |
|||
{ |
|||
await DisplayAlert("Authentication failed", "An error occurred while trying to authenticate the user.", "OK"); |
|||
} |
|||
} |
|||
|
|||
finally |
|||
{ |
|||
// Re-enable the buttons to allow starting a new operation.
|
|||
LocalLogin.IsEnabled = true; |
|||
LocalLoginWithGitHub.IsEnabled = true; |
|||
LocalLogout.IsEnabled = true; |
|||
TwitterLogin.IsEnabled = true; |
|||
} |
|||
} |
|||
|
|||
private async Task LogOutAsync(string provider, Dictionary<string, OpenIddictParameter>? parameters = null) |
|||
{ |
|||
// Disable the buttons to prevent concurrent operations.
|
|||
LocalLogin.IsEnabled = false; |
|||
LocalLoginWithGitHub.IsEnabled = false; |
|||
LocalLogout.IsEnabled = false; |
|||
TwitterLogin.IsEnabled = false; |
|||
|
|||
try |
|||
{ |
|||
using var source = new CancellationTokenSource(delay: TimeSpan.FromSeconds(90)); |
|||
|
|||
try |
|||
{ |
|||
// Ask OpenIddict to initiate the logout flow (typically, by starting the system browser).
|
|||
var result = await _service.SignOutInteractivelyAsync(new() |
|||
{ |
|||
AdditionalLogoutRequestParameters = parameters, |
|||
CancellationToken = source.Token, |
|||
ProviderName = provider |
|||
}); |
|||
|
|||
// Wait for the user to complete the logout process and authenticate the callback request.
|
|||
//
|
|||
// Note: in this case, only the claims contained in the state token can be resolved since
|
|||
// the authorization server doesn't return any other user identity during a logout dance.
|
|||
await _service.AuthenticateInteractivelyAsync(new() |
|||
{ |
|||
CancellationToken = source.Token, |
|||
Nonce = result.Nonce |
|||
}); |
|||
|
|||
await DisplayAlert("Logout demand successful", "The user was successfully logged out from the local server.", "OK"); |
|||
} |
|||
|
|||
catch (OperationCanceledException) |
|||
{ |
|||
await DisplayAlert("Logout timed out", "The logout process was aborted.", "OK"); |
|||
} |
|||
|
|||
catch |
|||
{ |
|||
await DisplayAlert("Logout failed", "An error occurred while trying to log the user out.", "OK"); |
|||
} |
|||
} |
|||
|
|||
finally |
|||
{ |
|||
// Re-enable the buttons to allow starting a new operation.
|
|||
LocalLogin.IsEnabled = true; |
|||
LocalLoginWithGitHub.IsEnabled = true; |
|||
LocalLogout.IsEnabled = true; |
|||
TwitterLogin.IsEnabled = true; |
|||
} |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,22 @@ |
|||
#if IOS || WINDOWS
|
|||
using Microsoft.Extensions.Hosting; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public class MauiHostApplicationLifetime : IHostApplicationLifetime |
|||
{ |
|||
private readonly CancellationTokenSource _source = new(); |
|||
|
|||
public CancellationToken ApplicationStarted => new(canceled: true); |
|||
|
|||
public CancellationToken ApplicationStopping => _source.Token; |
|||
|
|||
public CancellationToken ApplicationStopped => _source.Token; |
|||
|
|||
public void StopApplication() |
|||
{ |
|||
_source.Cancel(throwOnFirstException: false); |
|||
Environment.Exit(0); |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,16 @@ |
|||
#if IOS || WINDOWS
|
|||
using Microsoft.Extensions.Hosting; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public class MauiHostedServiceAdapter : IMauiInitializeService |
|||
{ |
|||
private readonly IHostedService _service; |
|||
|
|||
public MauiHostedServiceAdapter(IHostedService service) |
|||
=> _service = service ?? throw new ArgumentNullException(nameof(service)); |
|||
|
|||
public void Initialize(IServiceProvider services) |
|||
=> Task.Run(() => _service.StartAsync(CancellationToken.None)).GetAwaiter().GetResult(); |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,131 @@ |
|||
#if IOS || WINDOWS
|
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Hosting.Internal; |
|||
using Microsoft.Extensions.Logging; |
|||
using OpenIddict.Client; |
|||
using OpenIddict.Client.SystemIntegration; |
|||
using static OpenIddict.Abstractions.OpenIddictConstants; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public static class MauiProgram |
|||
{ |
|||
public static MauiApp CreateMauiApp() |
|||
{ |
|||
var builder = MauiApp.CreateBuilder(); |
|||
|
|||
builder.Logging.AddDebug(); |
|||
|
|||
builder.Services.AddDbContext<DbContext>(options => |
|||
{ |
|||
options.UseSqlite($"Filename={Path.Combine(Path.GetTempPath(), "openiddict-sandbox-maui-client.sqlite3")}"); |
|||
options.UseOpenIddict(); |
|||
}); |
|||
|
|||
builder.Services.AddOpenIddict() |
|||
|
|||
// Register the OpenIddict core components.
|
|||
.AddCore(options => |
|||
{ |
|||
// Configure OpenIddict to use the Entity Framework Core stores and models.
|
|||
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
|
|||
options.UseEntityFrameworkCore() |
|||
.UseDbContext<DbContext>(); |
|||
}) |
|||
|
|||
// Register the OpenIddict client components.
|
|||
.AddClient(options => |
|||
{ |
|||
// Note: this sample uses the authorization code and refresh token
|
|||
// flows, but you can enable the other flows if necessary.
|
|||
options.AllowAuthorizationCodeFlow() |
|||
.AllowRefreshTokenFlow(); |
|||
|
|||
// Register the signing and encryption credentials used to protect
|
|||
// sensitive data like the state tokens produced by OpenIddict.
|
|||
options.AddDevelopmentEncryptionCertificate() |
|||
.AddDevelopmentSigningCertificate(); |
|||
|
|||
// Register the operating system integration.
|
|||
options.UseSystemIntegration(); |
|||
|
|||
// Register the System.Net.Http integration and use the identity of the current
|
|||
// assembly as a more specific user agent, which can be useful when dealing with
|
|||
// providers that use the user agent as a way to throttle requests (e.g Reddit).
|
|||
options.UseSystemNetHttp() |
|||
.SetProductInformation(typeof(MauiProgram).Assembly); |
|||
|
|||
// Add a client registration matching the client application definition in the server project.
|
|||
options.AddRegistration(new OpenIddictClientRegistration |
|||
{ |
|||
Issuer = new Uri("https://localhost:44395/", UriKind.Absolute), |
|||
ProviderName = "Local", |
|||
|
|||
ClientId = "maui", |
|||
|
|||
// This sample uses protocol activations with a custom URI scheme to handle callbacks.
|
|||
//
|
|||
// For more information on how to construct private-use URI schemes,
|
|||
// read https://www.rfc-editor.org/rfc/rfc8252#section-7.1 and
|
|||
// https://www.rfc-editor.org/rfc/rfc7595#section-3.8.
|
|||
PostLogoutRedirectUri = new Uri("com.openiddict.sandbox.maui.client:/callback/logout/local", UriKind.Absolute), |
|||
RedirectUri = new Uri("com.openiddict.sandbox.maui.client:/callback/login/local", UriKind.Absolute), |
|||
|
|||
Scopes = { Scopes.Email, Scopes.Profile, Scopes.OfflineAccess, "demo_api" } |
|||
}); |
|||
|
|||
// Register the Web providers integrations.
|
|||
//
|
|||
// Note: to mitigate mix-up attacks, it's recommended to use a unique redirection endpoint
|
|||
// address per provider, unless all the registered providers support returning an "iss"
|
|||
// parameter containing their URL as part of authorization responses. For more information,
|
|||
// see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-4.4.
|
|||
options.UseWebProviders() |
|||
.AddTwitter(options => |
|||
{ |
|||
options.SetClientId("bXgwc0U3N3A3YWNuaWVsdlRmRWE6MTpjaQ") |
|||
// Note: Twitter doesn't support the recommended ":/" syntax and requires using "://".
|
|||
.SetRedirectUri("com.openiddict.sandbox.maui.client://callback/login/twitter"); |
|||
}); |
|||
}); |
|||
|
|||
builder.UseMauiApp<App>() |
|||
.ConfigureFonts(options => |
|||
{ |
|||
options.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); |
|||
options.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); |
|||
}); |
|||
|
|||
// Note: MAUI is not built on top of the .NET Generic Host and doesn't register any of
|
|||
// the services typically found in applications using the .NET Generic Host. Since these
|
|||
// services are required by the OpenIddict client system integration to handle callbacks
|
|||
// and redirect protocol activations to the correct instance, custom implementations are
|
|||
// registered here. For more information, see https://github.com/dotnet/maui/issues/2244.
|
|||
|
|||
builder.Services.AddSingleton<IHostEnvironment>(new HostingEnvironment |
|||
{ |
|||
ApplicationName = typeof(MauiProgram).Assembly.GetName().Name! |
|||
}); |
|||
|
|||
builder.Services.AddSingleton<IHostApplicationLifetime, MauiHostApplicationLifetime>(); |
|||
|
|||
builder.Services.AddSingleton<IMauiInitializeService>(static provider => new MauiHostedServiceAdapter( |
|||
ActivatorUtilities.CreateInstance<OpenIddictClientSystemIntegrationActivationHandler>(provider))); |
|||
|
|||
builder.Services.AddSingleton<IMauiInitializeService>(static provider => new MauiHostedServiceAdapter( |
|||
ActivatorUtilities.CreateInstance<OpenIddictClientSystemIntegrationHttpListener>(provider))); |
|||
|
|||
builder.Services.AddSingleton<IMauiInitializeService>(static provider => new MauiHostedServiceAdapter( |
|||
ActivatorUtilities.CreateInstance<OpenIddictClientSystemIntegrationPipeListener>(provider))); |
|||
|
|||
// Note: pages must be registered in the container to be able to use constructor injection.
|
|||
builder.Services.AddSingleton<MainPage>(); |
|||
|
|||
// Register the initialization service responsible for creating the SQLite database.
|
|||
builder.Services.AddScoped<IMauiInitializeScopedService, Worker>(); |
|||
|
|||
return builder.Build(); |
|||
} |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,47 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFrameworks Condition=" '$(SupportsWindowsPlatformTargeting)' == 'true' ">net8.0-windows10.0.19041</TargetFrameworks> |
|||
<TargetFrameworks Condition=" '$(SupportsIOSPlatformTargeting)' == 'true' ">$(TargetFrameworks);net8.0-ios17.2</TargetFrameworks> |
|||
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' ">net8.0</TargetFrameworks> |
|||
<UseMaui Condition=" '$(TargetPlatformIdentifier)' != '' ">true</UseMaui> |
|||
<SingleProject>true</SingleProject> |
|||
</PropertyGroup> |
|||
|
|||
<PropertyGroup> |
|||
<ApplicationTitle>OpenIddict.Sandbox.Maui.Client</ApplicationTitle> |
|||
<ApplicationId>com.openiddict.sandbox.maui.client</ApplicationId> |
|||
<ApplicationDisplayVersion>$(Version)</ApplicationDisplayVersion> |
|||
<ApplicationVersion>$(Version)</ApplicationVersion> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\OpenIddict.Client.SystemIntegration\OpenIddict.Client.SystemIntegration.csproj" /> |
|||
<ProjectReference Include="..\..\src\OpenIddict.Client.SystemNetHttp\OpenIddict.Client.SystemNetHttp.csproj" /> |
|||
<ProjectReference Include="..\..\src\OpenIddict.Client.WebIntegration\OpenIddict.Client.WebIntegration.csproj" /> |
|||
<ProjectReference Include="..\..\src\OpenIddict.EntityFrameworkCore\OpenIddict.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' != '' "> |
|||
<PackageReference Include="Microsoft.Maui.Controls" /> |
|||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> |
|||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" /> |
|||
<MauiImage Include="Resources\Images\*" /> |
|||
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> |
|||
<MauiFont Include="Resources\Fonts\*" /> |
|||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> |
|||
<MauiXaml Remove="**\*.xaml" Condition=" '$(TargetPlatformIdentifier)' == '' " /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,8 @@ |
|||
<maui:MauiWinUIApplication |
|||
x:Class="OpenIddict.Sandbox.Maui.Client.WinUI.App" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:maui="using:Microsoft.Maui" |
|||
xmlns:local="using:OpenIddict.Sandbox.Maui.Client.WinUI"> |
|||
|
|||
</maui:MauiWinUIApplication> |
|||
@ -0,0 +1,10 @@ |
|||
#if WINDOWS
|
|||
namespace OpenIddict.Sandbox.Maui.Client.WinUI; |
|||
|
|||
public partial class App : MauiWinUIApplication |
|||
{ |
|||
public App() => InitializeComponent(); |
|||
|
|||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,51 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Package |
|||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" |
|||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" |
|||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" |
|||
IgnorableNamespaces="uap rescap"> |
|||
|
|||
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" /> |
|||
|
|||
<Properties> |
|||
<DisplayName>$placeholder$</DisplayName> |
|||
<PublisherDisplayName>User Name</PublisherDisplayName> |
|||
<Logo>$placeholder$.png</Logo> |
|||
</Properties> |
|||
|
|||
<Dependencies> |
|||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> |
|||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> |
|||
</Dependencies> |
|||
|
|||
<Resources> |
|||
<Resource Language="x-generate" /> |
|||
</Resources> |
|||
|
|||
<Applications> |
|||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$"> |
|||
<uap:VisualElements |
|||
DisplayName="$placeholder$" |
|||
Description="$placeholder$" |
|||
Square150x150Logo="$placeholder$.png" |
|||
Square44x44Logo="$placeholder$.png" |
|||
BackgroundColor="transparent"> |
|||
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" /> |
|||
<uap:SplashScreen Image="$placeholder$.png" /> |
|||
</uap:VisualElements> |
|||
|
|||
<Extensions> |
|||
<uap:Extension Category="windows.protocol"> |
|||
<uap:Protocol Name="com.openiddict.sandbox.maui.client"> |
|||
<uap:DisplayName>OpenIddict MAUI client</uap:DisplayName> |
|||
</uap:Protocol> |
|||
</uap:Extension> |
|||
</Extensions> |
|||
</Application> |
|||
</Applications> |
|||
|
|||
<Capabilities> |
|||
<rescap:Capability Name="runFullTrust" /> |
|||
</Capabilities> |
|||
|
|||
</Package> |
|||
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<assemblyIdentity version="1.0.0.0" name="OpenIddict.Sandbox.Maui.Client.WinUI.app"/> |
|||
|
|||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> |
|||
<windowsSettings> |
|||
<!-- The combination of below two tags have the following effect: |
|||
1) Per-Monitor for >= Windows 10 Anniversary Update |
|||
2) System < Windows 10 Anniversary Update |
|||
--> |
|||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> |
|||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness> |
|||
</windowsSettings> |
|||
</application> |
|||
</assembly> |
|||
@ -0,0 +1,11 @@ |
|||
#if IOS
|
|||
using Foundation; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
[Register("AppDelegate")] |
|||
public class AppDelegate : MauiUIApplicationDelegate |
|||
{ |
|||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,45 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
|||
<plist version="1.0"> |
|||
<dict> |
|||
<key>LSRequiresIPhoneOS</key> |
|||
<true/> |
|||
<key>UIDeviceFamily</key> |
|||
<array> |
|||
<integer>1</integer> |
|||
<integer>2</integer> |
|||
</array> |
|||
<key>UIRequiredDeviceCapabilities</key> |
|||
<array> |
|||
<string>arm64</string> |
|||
</array> |
|||
<key>UISupportedInterfaceOrientations</key> |
|||
<array> |
|||
<string>UIInterfaceOrientationPortrait</string> |
|||
<string>UIInterfaceOrientationLandscapeLeft</string> |
|||
<string>UIInterfaceOrientationLandscapeRight</string> |
|||
</array> |
|||
<key>UISupportedInterfaceOrientations~ipad</key> |
|||
<array> |
|||
<string>UIInterfaceOrientationPortrait</string> |
|||
<string>UIInterfaceOrientationPortraitUpsideDown</string> |
|||
<string>UIInterfaceOrientationLandscapeLeft</string> |
|||
<string>UIInterfaceOrientationLandscapeRight</string> |
|||
</array> |
|||
<key>XSAppIconAssets</key> |
|||
<string>Assets.xcassets/appicon.appiconset</string> |
|||
<key>CFBundleURLTypes</key> |
|||
<array> |
|||
<dict> |
|||
<key>CFBundleURLName</key> |
|||
<string>Type d'URL 1</string> |
|||
<key>CFBundleURLSchemes</key> |
|||
<array> |
|||
<string>com.openiddict.sandbox.maui.client</string> |
|||
</array> |
|||
<key>CFBundleTypeRole</key> |
|||
<string>Editor</string> |
|||
</dict> |
|||
</array> |
|||
</dict> |
|||
</plist> |
|||
@ -0,0 +1,11 @@ |
|||
#if IOS
|
|||
using ObjCRuntime; |
|||
using UIKit; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public static class Program |
|||
{ |
|||
public static void Main(string[] args) => UIApplication.Main(args, null, typeof(AppDelegate)); |
|||
} |
|||
#endif
|
|||
@ -0,0 +1,3 @@ |
|||
#if !IOS && !WINDOWS
|
|||
Console.Error.WriteLine("This sample is only supported on iOS and Windows."); |
|||
#endif
|
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"profiles": { |
|||
"Windows Machine": { |
|||
"commandName": "MsixPackage", |
|||
"nativeDebugging": false |
|||
} |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 228 B |
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,15 @@ |
|||
Any raw assets you want to be deployed with your application can be placed in |
|||
this directory (and child directories). Deployment of the asset to your application |
|||
is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. |
|||
|
|||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> |
|||
|
|||
These files will be deployed with you package and will be accessible using Essentials: |
|||
|
|||
async Task LoadMauiAsset() |
|||
{ |
|||
using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); |
|||
using var reader = new StreamReader(stream); |
|||
|
|||
var contents = reader.ReadToEnd(); |
|||
} |
|||
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<?xaml-comp compile="true" ?> |
|||
<ResourceDictionary |
|||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> |
|||
|
|||
<Color x:Key="Primary">#512BD4</Color> |
|||
<Color x:Key="Secondary">#DFD8F7</Color> |
|||
<Color x:Key="Tertiary">#2B0B98</Color> |
|||
<Color x:Key="White">White</Color> |
|||
<Color x:Key="Black">Black</Color> |
|||
<Color x:Key="Gray100">#E1E1E1</Color> |
|||
<Color x:Key="Gray200">#C8C8C8</Color> |
|||
<Color x:Key="Gray300">#ACACAC</Color> |
|||
<Color x:Key="Gray400">#919191</Color> |
|||
<Color x:Key="Gray500">#6E6E6E</Color> |
|||
<Color x:Key="Gray600">#404040</Color> |
|||
<Color x:Key="Gray900">#212121</Color> |
|||
<Color x:Key="Gray950">#141414</Color> |
|||
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/> |
|||
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/> |
|||
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/> |
|||
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/> |
|||
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/> |
|||
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/> |
|||
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/> |
|||
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/> |
|||
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/> |
|||
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/> |
|||
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/> |
|||
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/> |
|||
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/> |
|||
|
|||
<Color x:Key="Yellow100Accent">#F7B548</Color> |
|||
<Color x:Key="Yellow200Accent">#FFD590</Color> |
|||
<Color x:Key="Yellow300Accent">#FFE5B9</Color> |
|||
<Color x:Key="Cyan100Accent">#28C2D1</Color> |
|||
<Color x:Key="Cyan200Accent">#7BDDEF</Color> |
|||
<Color x:Key="Cyan300Accent">#C3F2F4</Color> |
|||
<Color x:Key="Blue100Accent">#3E8EED</Color> |
|||
<Color x:Key="Blue200Accent">#72ACF1</Color> |
|||
<Color x:Key="Blue300Accent">#A7CBF6</Color> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,384 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<?xaml-comp compile="true" ?> |
|||
<ResourceDictionary |
|||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> |
|||
|
|||
<Style TargetType="ActivityIndicator"> |
|||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="IndicatorView"> |
|||
<Setter Property="IndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}"/> |
|||
<Setter Property="SelectedIndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray100}}"/> |
|||
</Style> |
|||
|
|||
<Style TargetType="Border"> |
|||
<Setter Property="Stroke" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" /> |
|||
<Setter Property="StrokeShape" Value="Rectangle"/> |
|||
<Setter Property="StrokeThickness" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style TargetType="BoxView"> |
|||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="Button"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Primary}}" /> |
|||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14"/> |
|||
<Setter Property="CornerRadius" Value="8"/> |
|||
<Setter Property="Padding" Value="14,10"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" /> |
|||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="CheckBox"> |
|||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="DatePicker"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Editor"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14" /> |
|||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Entry"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14" /> |
|||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Frame"> |
|||
<Setter Property="HasShadow" Value="False" /> |
|||
<Setter Property="BorderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="CornerRadius" Value="8" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="ImageButton"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
<Setter Property="BorderColor" Value="Transparent"/> |
|||
<Setter Property="BorderWidth" Value="0"/> |
|||
<Setter Property="CornerRadius" Value="0"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="Opacity" Value="0.5" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Label"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular" /> |
|||
<Setter Property="FontSize" Value="14" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="ListView"> |
|||
<Setter Property="SeparatorColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" /> |
|||
<Setter Property="RefreshControlColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="Picker"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="ProgressBar"> |
|||
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="RadioButton"> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="RefreshView"> |
|||
<Setter Property="RefreshColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="SearchBar"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" /> |
|||
<Setter Property="CancelButtonColor" Value="{StaticResource Gray500}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular" /> |
|||
<Setter Property="FontSize" Value="14" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="SearchHandler"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" /> |
|||
<Setter Property="BackgroundColor" Value="Transparent" /> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular" /> |
|||
<Setter Property="FontSize" Value="14" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Shadow"> |
|||
<Setter Property="Radius" Value="15" /> |
|||
<Setter Property="Opacity" Value="0.5" /> |
|||
<Setter Property="Brush" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}" /> |
|||
<Setter Property="Offset" Value="10,10" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="Slider"> |
|||
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" /> |
|||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/> |
|||
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/> |
|||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="SwipeItem"> |
|||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="Switch"> |
|||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="ThumbColor" Value="{StaticResource White}" /> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
<VisualState x:Name="On"> |
|||
<VisualState.Setters> |
|||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray200}}" /> |
|||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
<VisualState x:Name="Off"> |
|||
<VisualState.Setters> |
|||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="TimePicker"> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" /> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="FontFamily" Value="OpenSansRegular"/> |
|||
<Setter Property="FontSize" Value="14"/> |
|||
<Setter Property="VisualStateManager.VisualStateGroups"> |
|||
<VisualStateGroupList> |
|||
<VisualStateGroup x:Name="CommonStates"> |
|||
<VisualState x:Name="Normal" /> |
|||
<VisualState x:Name="Disabled"> |
|||
<VisualState.Setters> |
|||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" /> |
|||
</VisualState.Setters> |
|||
</VisualState> |
|||
</VisualStateGroup> |
|||
</VisualStateGroupList> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="Page" ApplyToDerivedTypes="True"> |
|||
<Setter Property="Padding" Value="0"/> |
|||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="Shell" ApplyToDerivedTypes="True"> |
|||
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="Shell.ForegroundColor" Value="{OnPlatform WinUI={StaticResource Primary}, Default={StaticResource White}}" /> |
|||
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}" /> |
|||
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" /> |
|||
<Setter Property="Shell.NavBarHasShadow" Value="False" /> |
|||
<Setter Property="Shell.TabBarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" /> |
|||
<Setter Property="Shell.TabBarForegroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="Shell.TabBarTitleColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="Shell.TabBarUnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="NavigationPage"> |
|||
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" /> |
|||
<Setter Property="IconColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" /> |
|||
</Style> |
|||
|
|||
<Style TargetType="TabbedPage"> |
|||
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" /> |
|||
<Setter Property="UnselectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" /> |
|||
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" /> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,14 @@ |
|||
#if IOS || WINDOWS
|
|||
using Microsoft.EntityFrameworkCore; |
|||
|
|||
namespace OpenIddict.Sandbox.Maui.Client; |
|||
|
|||
public class Worker : IMauiInitializeScopedService |
|||
{ |
|||
public void Initialize(IServiceProvider services) |
|||
{ |
|||
var context = services.GetRequiredService<DbContext>(); |
|||
context.Database.EnsureCreated(); |
|||
} |
|||
} |
|||
#endif
|
|||
Loading…
Reference in new issue