Skip to content

Commit

Permalink
InitialzationOption for MauiApp
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Mar 25, 2022
1 parent d4a3039 commit 1688524
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Compatibility/Core/src/Tizen/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public struct EffectScope
public string Name;
public ExportEffectAttribute[] Effects;
}
public InitializationOptions()
{
}

public InitializationOptions(CoreApplication application)
{
Expand Down Expand Up @@ -458,6 +461,14 @@ static void SetupInit(IMauiContext context, InitializationOptions options = null
if (options?.Flags.HasFlag(InitializationFlags.SkipRenderers) != true)
RegisterCompatRenderers(options);

if (options != null)
{
s_platformType = options.PlatformType;
s_useMessagingCenter = options.UseMessagingCenter;
UseSkiaSharp = options.UseSkiaSharp;
UseFastLayout = options.UseFastLayout;
}

Application.AccentColor = GetAccentColor(profile);
ExpressionSearch.Default = new TizenExpressionSearch();

Expand Down
11 changes: 11 additions & 0 deletions src/Controls/samples/Controls.Sample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ public static MauiApp CreateMauiApp()
logging.AddConsole();
#endif
});
#if TIZEN
services.AddTransient<InitializationOptions>((_) =>
{
var option = new InitializationOptions
{
DisplayResolutionUnit = DisplayResolutionUnit.DP(true),
UseSkiaSharp = true
};
return option;
});
#endif

services.AddSingleton<ITextService, TextService>();
services.AddTransient<MainViewModel>();
Expand Down

0 comments on commit 1688524

Please sign in to comment.