Cleaning up the solution. Separating Shared.WinRT, Services and Synchronization. Removing synchronization from app. Reducing bundle size by 45mb.
This commit is contained in:
31
Wino.Shared.WinRT/Models/Personalization/CustomAppTheme.cs
Normal file
31
Wino.Shared.WinRT/Models/Personalization/CustomAppTheme.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage;
|
||||
using Wino.Domain.Enums;
|
||||
using Wino.Domain.Models.Personalization;
|
||||
using Wino.Shared.WinRT.Services;
|
||||
|
||||
namespace Wino.Shared.WinRT.Models.Personalization
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom themes that are generated by users.
|
||||
/// </summary>
|
||||
public class CustomAppTheme : AppThemeBase
|
||||
{
|
||||
public CustomAppTheme(CustomThemeMetadata metadata) : base(metadata.Name, metadata.Id)
|
||||
{
|
||||
AccentColor = metadata.AccentColorHex;
|
||||
}
|
||||
|
||||
public override AppThemeType AppThemeType => AppThemeType.Custom;
|
||||
|
||||
public override string GetBackgroundPreviewImagePath()
|
||||
=> $"ms-appdata:///local/{ThemeService.CustomThemeFolderName}/{Id}_preview.jpg";
|
||||
|
||||
public override async Task<string> GetThemeResourceDictionaryContentAsync()
|
||||
{
|
||||
var customAppThemeFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AppThemes/Custom.xaml"));
|
||||
return await FileIO.ReadTextAsync(customAppThemeFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user