Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvvm #112

Closed
wants to merge 13 commits into from
Closed

Mvvm #112

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions Mail.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "repo", "repo", "{0D036B62-A
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicaApps.Mail.UWP", "src\MicaApps.Mail.UWP\MicaApps.Mail.UWP.csproj", "{2601D787-59C4-4C96-9608-E7C7DA16DA39}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicaApps.Mail", "src\MicaApps.Mail\MicaApps.Mail.csproj", "{A910A7C5-9F5C-457C-88B6-4CED1725398A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -68,26 +66,6 @@ Global
{2601D787-59C4-4C96-9608-E7C7DA16DA39}.Release|x86.ActiveCfg = Release|x86
{2601D787-59C4-4C96-9608-E7C7DA16DA39}.Release|x86.Build.0 = Release|x86
{2601D787-59C4-4C96-9608-E7C7DA16DA39}.Release|x86.Deploy.0 = Release|x86
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|ARM.Build.0 = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|ARM64.Build.0 = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|x64.ActiveCfg = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|x64.Build.0 = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|x86.ActiveCfg = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Debug|x86.Build.0 = Debug|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|Any CPU.Build.0 = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|ARM.ActiveCfg = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|ARM.Build.0 = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|ARM64.ActiveCfg = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|ARM64.Build.0 = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|x64.ActiveCfg = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|x64.Build.0 = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|x86.ActiveCfg = Release|Any CPU
{A910A7C5-9F5C-457C-88B6-4CED1725398A}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified src/MicaApps.Mail.UWP/Assets/LargeTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/LargeTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/LargeTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/LargeTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/LargeTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SmallTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SmallTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SmallTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SmallTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SmallTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SplashScreen.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SplashScreen.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SplashScreen.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/SplashScreen.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square150x150Logo.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square150x150Logo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square150x150Logo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square150x150Logo.scale-400.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.scale-100.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.scale-125.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.scale-150.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.scale-200.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.scale-400.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.targetsize-16.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.targetsize-24.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.targetsize-256.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.targetsize-32.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Square44x44Logo.targetsize-48.png
Binary file modified src/MicaApps.Mail.UWP/Assets/StoreLogo.scale-100.png
Binary file modified src/MicaApps.Mail.UWP/Assets/StoreLogo.scale-125.png
Binary file modified src/MicaApps.Mail.UWP/Assets/StoreLogo.scale-150.png
Binary file modified src/MicaApps.Mail.UWP/Assets/StoreLogo.scale-200.png
Binary file modified src/MicaApps.Mail.UWP/Assets/StoreLogo.scale-400.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Wide310x150Logo.scale-100.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Wide310x150Logo.scale-125.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Wide310x150Logo.scale-150.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Wide310x150Logo.scale-200.png
Binary file modified src/MicaApps.Mail.UWP/Assets/Wide310x150Logo.scale-400.png
104 changes: 92 additions & 12 deletions src/MicaApps.Mail.UWP/Converters/ContactToAvatarConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
#nullable enable
using System;
using System.Buffers.Text;
using System.Collections.Generic;
using System.IO;
Expand All @@ -12,12 +13,17 @@
using Mail.Services.Data;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Toolkit.Uwp.Helpers;
using System.Net.Mail;
using System.Net.Http;
using System.Diagnostics;

namespace Mail.Converters;

public class ContactToAvatarConverter : IValueConverter
{
private ICacheService? CacheService;
private Dictionary<string, BitmapImage?> _instantCache = new();
private readonly HttpClient httpClient =new HttpClient();

public ContactToAvatarConverter()
{
Expand All @@ -26,21 +32,95 @@ public ContactToAvatarConverter()

public object Convert(object value, Type targetType, object parameter, string language)
{
var contacts = CacheService?.GetCache<IReadOnlyList<ContactModel>>();
if (value is string recipient && contacts is not null)
try
{
if (contacts.FirstOrDefault(t => t.Address == recipient) is { } contact)
var contacts = CacheService?.GetCache<IReadOnlyList<ContactModel>>();
if (value is string recipient)
{
contact.Avatar.Seek(0, SeekOrigin.Begin);
var ret = new StreamReader(contact.Avatar).ReadToEnd();
byte[] bytes = System.Convert.FromBase64String(ret);
var bitmap = new BitmapImage();
MemoryStream ms = new MemoryStream(bytes);
bitmap.SetSourceAsync(ms.AsRandomAccessStream());

return bitmap;
byte[]? resultByte = null;

if (contacts is not null && contacts.FirstOrDefault(t => t.Address == recipient) is { } contact)
{
contact.Avatar.Seek(0, SeekOrigin.Begin);
var ret = new StreamReader(contact.Avatar).ReadToEnd();
resultByte = System.Convert.FromBase64String(ret);
}
else
{
if (true)
{
if (_instantCache.ContainsKey(recipient))
return _instantCache[recipient];
var domainSplit = new MailAddress(recipient).Host.Split('.');
if (domainSplit.Length > 3 && (domainSplit[domainSplit.Length - 2] == "co" ||
domainSplit[domainSplit.Length - 2] == "com"))
{
recipient = domainSplit[domainSplit.Length - 3] + "." +
domainSplit[domainSplit.Length - 2] + "." +
domainSplit[domainSplit.Length - 1];
}
else
{
recipient = domainSplit[domainSplit.Length - 2] + "." +
domainSplit[domainSplit.Length - 1];
}
if (_instantCache.ContainsKey(recipient))
return _instantCache[recipient];

if (false)
{
// I'M EVIL
try
{
// BAD PRACTICE!
resultByte = httpClient.GetByteArrayAsync($"https://{recipient}/favicon.ico").GetAwaiter().GetResult();
if (resultByte[0] == 0x00 && resultByte[1] == 0x00 && resultByte[2] == 0x01 && resultByte[3] == 0x00)
{
// noting
}
else
{

throw new BadImageFormatException();
}

}
catch (Exception ex)
{
resultByte = null;
}
}
else
{
var bitmap = new BitmapImage();
bitmap.UriSource = new Uri("https://" + recipient + "/favicon.ico");
_instantCache[recipient] = bitmap;
return bitmap;
}



}
}
if (resultByte != null)
{
var bitmap = new BitmapImage();
MemoryStream ms = new MemoryStream(resultByte);
bitmap.SetSourceAsync(ms.AsRandomAccessStream());
_instantCache[recipient] = bitmap;
}
else
{
_instantCache[recipient] = null;
}

return _instantCache[recipient]!;
}
}
catch
{
// ignore
}

return null!;
}
Expand Down
9 changes: 0 additions & 9 deletions src/MicaApps.Mail.UWP/Extensions/CustomDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@ public CustomDbContext(IDbConnectionFactory dbConnectionFactory) : base(dbConnec

}

public CustomDbContext(IDbConnectionFactory dbConnectionFactory, bool concurrencyMode) : base(dbConnectionFactory, concurrencyMode)
{

}

public CustomDbContext(Func<IDbConnection> dbConnectionFactory) : base(dbConnectionFactory)
{

}

public CustomDbContext(Func<IDbConnection> dbConnectionFactory, bool concurrencyMode) : base(dbConnectionFactory, concurrencyMode)
{

}

protected override Task<int> Delete<TEntity>(TEntity entity, string table, bool async)
{
this.GetDbOperationEvent().OnExecEvent(entity, OperationType.Delete);
Expand Down
43 changes: 26 additions & 17 deletions src/MicaApps.Mail.UWP/Extensions/DependencyObjectExtension.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml;
using Windows.UI.Popups;

namespace Mail.Extensions
{
Expand Down Expand Up @@ -39,32 +40,40 @@ public static T FindChildOfType<T>(this DependencyObject root) where T : Depende

public static T FindChildOfName<T>(this DependencyObject Parent, string Name) where T : DependencyObject
{
Queue<DependencyObject> ObjectQueue = new Queue<DependencyObject>();

ObjectQueue.Enqueue(Parent);

while (ObjectQueue.Count > 0)
try
{
DependencyObject Current = ObjectQueue.Dequeue();
Queue<DependencyObject> ObjectQueue = new Queue<DependencyObject>();

if (Current != null)
ObjectQueue.Enqueue(Parent);

while (ObjectQueue.Count > 0)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(Current); i++)
{
DependencyObject ChildObject = VisualTreeHelper.GetChild(Current, i);
DependencyObject Current = ObjectQueue.Dequeue();

if (ChildObject is T TypedChild && (TypedChild as FrameworkElement)?.Name == Name)
{
return TypedChild;
}
else
if (Current != null)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(Current); i++)
{
ObjectQueue.Enqueue(ChildObject);
DependencyObject ChildObject = VisualTreeHelper.GetChild(Current, i);

if (ChildObject is T TypedChild && (TypedChild as FrameworkElement)?.Name == Name)
{
return TypedChild;
}
else
{
ObjectQueue.Enqueue(ChildObject);
}
}
}
}
}


}
catch (System.Exception ex)
{
string b = ex.Message;
}
return null;
}

Expand Down
45 changes: 31 additions & 14 deletions src/MicaApps.Mail.UWP/MicaApps.Mail.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Use64BitCompiler>true</Use64BitCompiler>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -135,6 +144,9 @@
<Compile Include="Extensions\RunCatch.cs" />
<Compile Include="Models\EditMailOption.cs" />
<Compile Include="Models\LoadMailMessageOption.cs" />
<Compile Include="PageModels\LoginPageModel.cs" />
<Compile Include="PageModels\MainPageModel.cs" />
<Compile Include="PageModels\SplashPageModel.cs" />
<Compile Include="Pages\BlankPage.xaml.cs">
<DependentUpon>BlankPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -165,7 +177,7 @@
<Compile Include="Services\Data\MailMessageContentType.cs" />
<Compile Include="Extensions\ICollectionExtension.cs" />
<Compile Include="Extensions\Graph\IProviderExtension.cs" />
<Compile Include="MainPage.xaml.cs">
<Compile Include="Pages\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\HomePage.xaml.cs">
Expand Down Expand Up @@ -243,6 +255,7 @@
<Content Include="Assets\Wide310x150Logo.scale-150.png" />
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
<Content Include="Assets\sql.sql" />
<None Include="Package.StoreAssociation.xml" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
Expand All @@ -258,7 +271,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Page Include="Pages\MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand Down Expand Up @@ -301,43 +314,49 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Chloe">
<Version>5.10.0</Version>
<Version>5.19.0</Version>
</PackageReference>
<PackageReference Include="Chloe.SQLite">
<Version>5.10.0</Version>
<Version>5.19.0</Version>
</PackageReference>
<PackageReference Include="CommunityToolkit.Authentication.Uwp">
<Version>7.1.4</Version>
</PackageReference>
<PackageReference Include="CommunityToolkit.Labs.Uwp.SettingsControls">
<Version>0.0.13</Version>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm">
<Version>8.2.2</Version>
</PackageReference>
<PackageReference Include="MicaForUWP">
<Version>0.1.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.Data.Sqlite">
<Version>7.0.12</Version>
<Version>8.0.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory">
<Version>8.0.0-preview.4.23259.5</Version>
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection">
<Version>7.0.0</Version>
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Graph">
<Version>5.12.0</Version>
<Version>5.44.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client">
<Version>4.56.0</Version>
<Version>4.59.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Behaviors">
<Version>7.1.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>7.1.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.8.5</Version>
<Version>2.8.6</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
Expand All @@ -350,10 +369,8 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MicaApps.Mail\MicaApps.Mail.csproj">
<Project>{a910a7c5-9f5c-457c-88b6-4ced1725398a}</Project>
<Name>MicaApps.Mail</Name>
</ProjectReference>
<Folder Include="BLL\" />
<Folder Include="DAL\" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
Expand Down
2 changes: 2 additions & 0 deletions src/MicaApps.Mail.UWP/Models/LoadMailMessageOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public sealed class LoadMailMessageOption
public int LoadCount { get; set; } = 30;

public bool IsFocusedTab { get; set; } = true;

public bool ForceReload { get; set; } = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ public string PreviewText

public string SenderName
{
get => InnerData.Sender.Name;
get
{
return InnerData.Sender?.Name ?? string.Empty;
}
set => InnerData.Sender.Name = value;
}

Expand Down
Loading
Loading