Initial commit.
This commit is contained in:
59
Wino.Mail/Dialogs/AccountCreationDialog.xaml
Normal file
59
Wino.Mail/Dialogs/AccountCreationDialog.xaml
Normal file
@@ -0,0 +1,59 @@
|
||||
<dialogs:BaseAccountCreationDialog
|
||||
xmlns:dialogs="using:Wino.Dialogs"
|
||||
x:Class="Wino.Dialogs.AccountCreationDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="Root"
|
||||
CornerRadius="8"
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="RootGrid" RowSpacing="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Viewbox Width="24">
|
||||
<PathIcon x:Name="DialogIcon" />
|
||||
</Viewbox>
|
||||
|
||||
<muxc:ProgressBar Grid.Row="1" IsIndeterminate="True" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="StatusText"
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Center"
|
||||
Text="{x:Bind domain:Translator.AccountCreationDialog_Initializing}"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
</Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="DialogStates">
|
||||
<VisualState x:Name="PreparingFolders">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="StatusText.Text" Value="{x:Bind domain:Translator.AccountCreationDialog_PreparingFolders}" />
|
||||
<Setter Target="DialogIcon.Data" Value="M1024,317.5L1024,507C1014.67,495.333 1004.67,484.167 994,473.5C983.333,462.833 972,453 960,444L960,320C960,311.333 958.333,303.083 955,295.25C951.667,287.417 947.083,280.583 941.25,274.75C935.417,268.917 928.583,264.333 920.75,261C912.917,257.667 904.667,256 896,256L522,256L458,298.5C436,312.833 412.333,320 387,320L64,320L64,832C64,841 65.6667,849.417 69,857.25C72.3333,865.083 76.8333,871.833 82.5,877.5C88.1667,883.167 94.9167,887.667 102.75,891C110.583,894.333 119,896 128,896L404.5,896C410.167,907.333 416.25,918.333 422.75,929C429.25,939.667 436.333,950 444,960L125.5,960C108.833,960 92.9167,956.583 77.75,949.75C62.5833,942.917 49.25,933.75 37.75,922.25C26.25,910.75 17.0833,897.417 10.25,882.25C3.41667,867.083 0,851.167 0,834.5L0,189.5C0,172.833 3.41667,156.917 10.25,141.75C17.0833,126.583 26.25,113.25 37.75,101.75C49.25,90.25 62.5833,81.0834 77.75,74.25C92.9167,67.4167 108.833,64.0001 125.5,64L368,64C388,64.0001 407.167,68.5001 425.5,77.5C443.833,86.5001 458.833,99.0001 470.5,115L528,192L898.5,192C915.167,192 931.083,195.417 946.25,202.25C961.417,209.083 974.75,218.25 986.25,229.75C997.75,241.25 1006.92,254.583 1013.75,269.75C1020.58,284.917 1024,300.833 1024,317.5ZM466,216L419,153.5C413,145.5 405.5,139.25 396.5,134.75C387.5,130.25 378,128 368,128L128,128C119,128 110.667,129.667 103,133C95.3333,136.333 88.5833,140.917 82.75,146.75C76.9167,152.583 72.3333,159.333 69,167C65.6667,174.667 64,183 64,192L64,256L387,256C394.333,256 401.5,254.667 408.5,252C415.5,249.333 422.25,246 428.75,242C435.25,238 441.583,233.667 447.75,229C453.917,224.333 460,220 466,216ZM1024,736C1024,775.667 1016.42,813 1001.25,848C986.083,883 965.5,913.5 939.5,939.5C913.5,965.5 883,986.083 848,1001.25C813,1016.42 775.667,1024 736,1024C696,1024 658.5,1016.5 623.5,1001.5C588.5,986.5 558,966 532,940C506,914 485.5,883.5 470.5,848.5C455.5,813.5 448,776 448,736C448,696.333 455.583,659 470.75,624C485.917,589 506.5,558.5 532.5,532.5C558.5,506.5 589,485.917 624,470.75C659,455.583 696.333,448 736,448C762.333,448 787.75,451.417 812.25,458.25C836.75,465.083 859.667,474.75 881,487.25C902.333,499.75 921.833,514.833 939.5,532.5C957.167,550.167 972.25,569.667 984.75,591C997.25,612.333 1006.92,635.25 1013.75,659.75C1020.58,684.25 1024,709.667 1024,736ZM896,576C896,567.333 892.833,559.833 886.5,553.5C880.167,547.167 872.667,544 864,544C857.667,544 852.5,545.167 848.5,547.5C844.5,549.833 841.25,552.917 838.75,556.75C836.25,560.583 834.5,565 833.5,570C832.5,575 832,580.167 832,585.5C816.333,577.167 800.917,570.833 785.75,566.5C770.583,562.167 754,560 736,560C724,560 711.75,561.25 699.25,563.75C686.75,566.25 674.5,569.917 662.5,574.75C650.5,579.583 639.083,585.417 628.25,592.25C617.417,599.083 608,607 600,616C597,619.333 594.667,622.75 593,626.25C591.333,629.75 590.5,633.833 590.5,638.5C590.5,647.5 593.667,655.167 600,661.5C606.333,667.833 614,671 623,671C628.667,671 634.75,668.583 641.25,663.75C647.75,658.917 655.333,653.5 664,647.5C672.667,641.5 682.75,636.083 694.25,631.25C705.75,626.417 719.333,624 735,624C746.667,624 757.5,625.25 767.5,627.75C777.5,630.25 787.667,634.333 798,640L785,640C779,640 773.083,640.25 767.25,640.75C761.417,641.25 756.167,642.583 751.5,644.75C746.833,646.917 743.083,650.167 740.25,654.5C737.417,658.833 736,664.667 736,672C736,680.667 739.167,688.167 745.5,694.5C751.833,700.833 759.333,704 768,704L864,704C872.667,704 880.167,700.833 886.5,694.5C892.833,688.167 896,680.667 896,672ZM881.5,833C881.5,824.333 878.333,816.833 872,810.5C865.667,804.167 858.167,801 849.5,801C842.833,801 836.333,803.417 830,808.25C823.667,813.083 816.333,818.5 808,824.5C799.667,830.5 789.833,835.917 778.5,840.75C767.167,845.583 753.333,848 737,848C725.333,848 714.5,846.75 704.5,844.25C694.5,841.75 684.333,837.667 674,832L687,832C692.667,832 698.417,831.75 704.25,831.25C710.083,830.75 715.333,829.417 720,827.25C724.667,825.083 728.5,821.833 731.5,817.5C734.5,813.167 736,807.333 736,800C736,791.333 732.833,783.833 726.5,777.5C720.167,771.167 712.667,768 704,768L608,768C599.333,768 591.833,771.167 585.5,777.5C579.167,783.833 576,791.333 576,800L576,896C576,904.667 579.167,912.167 585.5,918.5C591.833,924.833 599.333,928 608,928C614.333,928 619.5,926.833 623.5,924.5C627.5,922.167 630.75,919.083 633.25,915.25C635.75,911.417 637.5,907 638.5,902C639.5,897 640,891.833 640,886.5C655.667,894.833 671.083,901.167 686.25,905.5C701.417,909.833 718,912 736,912C748,912 760.333,910.75 773,908.25C785.667,905.75 797.917,902.083 809.75,897.25C821.583,892.417 832.833,886.583 843.5,879.75C854.167,872.917 863.667,865 872,856C878.333,849.333 881.5,841.667 881.5,833Z" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="SigningIn">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="StatusText.Text" Value="{x:Bind domain:Translator.AccountCreationDialog_SigninIn}" />
|
||||
<Setter Target="DialogIcon.Glyph" Value="M128,220C128,190 134.083,161.667 146.25,135C158.417,108.333 174.75,85 195.25,65C215.75,45 239.5,29.1667 266.5,17.5C293.5,5.83337 322,0 352,0C382.667,0 411.583,5.91669 438.75,17.75C465.917,29.5834 489.667,45.6667 510,66C530.333,86.3334 546.417,110.083 558.25,137.25C570.083,164.417 576,193.333 576,224C576,254.667 570.083,283.583 558.25,310.75C546.417,337.917 530.333,361.667 510,382C489.667,402.333 465.917,418.417 438.75,430.25C411.583,442.083 382.667,448 352,448C320.333,448 290.833,442 263.5,430C236.167,418 212.5,401.667 192.5,381C172.5,360.333 156.75,336.167 145.25,308.5C133.75,280.833 128,251.333 128,220ZM512,220.5C512,198.833 507.667,178.5 499,159.5C490.333,140.5 478.667,123.917 464,109.75C449.333,95.5834 432.333,84.4167 413,76.25C393.667,68.0834 373.333,64.0001 352,64C329.667,64.0001 308.833,68.1667 289.5,76.5C270.167,84.8334 253.25,96.25 238.75,110.75C224.25,125.25 212.833,142.167 204.5,161.5C196.167,180.833 192,201.667 192,224C192,246.333 196.167,267.167 204.5,286.5C212.833,305.833 224.25,322.75 238.75,337.25C253.25,351.75 270.167,363.167 289.5,371.5C308.833,379.833 329.667,384 352,384C375,384 396.25,379.75 415.75,371.25C435.25,362.75 452.167,351.083 466.5,336.25C480.833,321.417 492,304.083 500,284.25C508,264.417 512,243.167 512,220.5ZM640,284.5C640,262.833 644.333,242.5 653,223.5C661.667,204.5 673.333,187.917 688,173.75C702.667,159.583 719.667,148.417 739,140.25C758.333,132.083 778.667,128 800,128C822.333,128 843.167,132.167 862.5,140.5C881.833,148.833 898.75,160.25 913.25,174.75C927.75,189.25 939.167,206.167 947.5,225.5C955.833,244.833 960,265.667 960,288C960,310.333 955.833,331.167 947.5,350.5C939.167,369.833 927.75,386.75 913.25,401.25C898.75,415.75 881.833,427.167 862.5,435.5C843.167,443.833 822.333,448 800,448C777,448 755.75,443.75 736.25,435.25C716.75,426.75 699.833,415.083 685.5,400.25C671.167,385.417 660,368.083 652,348.25C644,328.417 640,307.167 640,284.5ZM896,288C896,275 893.5,262.667 888.5,251C883.5,239.333 876.583,229.083 867.75,220.25C858.917,211.417 848.667,204.5 837,199.5C825.333,194.5 813,192 800,192C787,192 774.667,194.5 763,199.5C751.333,204.5 741.083,211.417 732.25,220.25C723.417,229.083 716.5,239.333 711.5,251C706.5,262.667 704,275 704,288C704,301 706.5,313.333 711.5,325C716.5,336.667 723.417,346.917 732.25,355.75C741.083,364.583 751.333,371.5 763,376.5C774.667,381.5 787,384 800,384C813,384 825.333,381.5 837,376.5C848.667,371.5 858.917,364.583 867.75,355.75C876.583,346.917 883.5,336.667 888.5,325C893.5,313.333 896,301 896,288ZM0,638C0,623.667 2.41667,609 7.25,594C12.0833,579 19,565.417 28,553.25C37,541.083 47.9167,531.167 60.75,523.5C73.5833,515.833 88,512 104,512L600,512C616,512 630.417,515.833 643.25,523.5C656.083,531.167 667,541.083 676,553.25C685,565.417 691.917,579 696.75,594C701.583,609 704,623.667 704,638C704,667 701,694.917 695,721.75C689,748.583 679.75,773.833 667.25,797.5C654.75,821.167 639.083,842.917 620.25,862.75C601.417,882.583 579.167,899.833 553.5,914.5C538.5,923.167 522.75,930.417 506.25,936.25C489.75,942.083 473,946.75 456,950.25C439,953.75 421.75,956.25 404.25,957.75C386.75,959.25 369.333,960 352,960C317,960 282.333,956.833 248,950.5C213.667,944.167 181.167,932.167 150.5,914.5C124.5,899.5 102.083,882.167 83.25,862.5C64.4167,842.833 48.8333,821.25 36.5,797.75C24.1667,774.25 15,749.083 9,722.25C3,695.417 0,667.333 0,638ZM698.5,896C714.833,876.333 728.833,854.5 740.5,830.5C771.5,828.167 800.417,822.417 827.25,813.25C854.083,804.083 877.333,791.083 897,774.25C916.667,757.417 932.083,736.583 943.25,711.75C954.417,686.917 960,657.667 960,624C960,619 959.25,613.75 957.75,608.25C956.25,602.75 954.083,597.583 951.25,592.75C948.417,587.917 944.833,583.917 940.5,580.75C936.167,577.583 931.167,576 925.5,576L775,576C771.333,564.667 767,553.583 762,542.75C757,531.917 751.167,521.667 744.5,512L925.5,512C940.167,512 953.583,515.25 965.75,521.75C977.917,528.25 988.333,536.75 997,547.25C1005.67,557.75 1012.33,569.75 1017,583.25C1021.67,596.75 1024,610.333 1024,624C1024,675.333 1012.5,720.833 989.5,760.5C966.5,800.167 932.333,832.333 887,857C858.333,872.667 827.833,883.083 795.5,888.25C763.167,893.417 730.833,896 698.5,896ZM640,640C640,634.333 639.167,627.75 637.5,620.25C635.833,612.75 633.25,605.75 629.75,599.25C626.25,592.75 621.833,587.25 616.5,582.75C611.167,578.25 605,576 598,576L106,576C99,576 92.8333,578.25 87.5,582.75C82.1667,587.25 77.75,592.75 74.25,599.25C70.75,605.75 68.1667,612.75 66.5,620.25C64.8333,627.75 64,634.333 64,640C64,684.333 71.25,722.583 85.75,754.75C100.25,786.917 120.333,813.5 146,834.5C171.667,855.5 202.083,871 237.25,881C272.417,891 310.667,896 352,896C393.333,896 431.583,891 466.75,881C501.917,871 532.333,855.5 558,834.5C583.667,813.5 603.75,786.917 618.25,754.75C632.75,722.583 640,684.333 640,640Z" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Completed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="StatusText.Text" Value="{x:Bind domain:Translator.AccountCreationDialog_Completed}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Idle" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</dialogs:BaseAccountCreationDialog>
|
||||
33
Wino.Mail/Dialogs/AccountCreationDialog.xaml.cs
Normal file
33
Wino.Mail/Dialogs/AccountCreationDialog.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Helpers;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class AccountCreationDialog : BaseAccountCreationDialog
|
||||
{
|
||||
public AccountCreationDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override void UpdateState()
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case AccountCreationDialogState.SigningIn:
|
||||
StatusText.Text = "Account information is being saved.";
|
||||
DialogIcon.Data = XamlHelpers.GetPathIcon("SavingAccountPathIcon");
|
||||
break;
|
||||
case AccountCreationDialogState.PreparingFolders:
|
||||
StatusText.Text = "We are getting folder information at the moment.";
|
||||
DialogIcon.Data = XamlHelpers.GetPathIcon("PreparingFoldersPathIcon");
|
||||
break;
|
||||
case AccountCreationDialogState.Completed:
|
||||
StatusText.Text = "All done.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Wino.Mail/Dialogs/AccountEditDialog.xaml
Normal file
19
Wino.Mail/Dialogs/AccountEditDialog.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.AccountEditDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="{x:Bind domain:Translator.AccountEditDialog_Title}"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Save}"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Discard}"
|
||||
PrimaryButtonClick="SaveClicked">
|
||||
|
||||
<Grid>
|
||||
<TextBox Text="{x:Bind Account.Name, Mode=TwoWay}" Header="{x:Bind domain:Translator.AccountEditDialog_Message}" />
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
22
Wino.Mail/Dialogs/AccountEditDialog.xaml.cs
Normal file
22
Wino.Mail/Dialogs/AccountEditDialog.xaml.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class AccountEditDialog : ContentDialog
|
||||
{
|
||||
public MailAccount Account { get; private set; }
|
||||
public bool IsSaved { get; set; }
|
||||
|
||||
public AccountEditDialog(MailAccount account)
|
||||
{
|
||||
InitializeComponent();
|
||||
Account = account;
|
||||
}
|
||||
|
||||
private void SaveClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
IsSaved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Wino.Mail/Dialogs/AccountPickerDialog.xaml
Normal file
19
Wino.Mail/Dialogs/AccountPickerDialog.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.AccountPickerDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
Title="{x:Bind domain:Translator.AccountPickerDialog_Title}">
|
||||
|
||||
<ListView
|
||||
ItemsSource="{x:Bind AvailableAccounts}"
|
||||
IsItemClickEnabled="True"
|
||||
DisplayMemberPath="Address"
|
||||
SelectionMode="None"
|
||||
ItemClick="AccountClicked" />
|
||||
</ContentDialog>
|
||||
27
Wino.Mail/Dialogs/AccountPickerDialog.xaml.cs
Normal file
27
Wino.Mail/Dialogs/AccountPickerDialog.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class AccountPickerDialog : ContentDialog
|
||||
{
|
||||
public MailAccount PickedAccount { get; set; }
|
||||
|
||||
public List<MailAccount> AvailableAccounts { get; set; }
|
||||
|
||||
public AccountPickerDialog(List<MailAccount> availableAccounts)
|
||||
{
|
||||
AvailableAccounts = availableAccounts;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void AccountClicked(object sender, ItemClickEventArgs e)
|
||||
{
|
||||
PickedAccount = e.ClickedItem as MailAccount;
|
||||
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Wino.Mail/Dialogs/BaseAccountCreationDialog.cs
Normal file
52
Wino.Mail/Dialogs/BaseAccountCreationDialog.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public abstract class BaseAccountCreationDialog : ContentDialog, IAccountCreationDialog
|
||||
{
|
||||
public AccountCreationDialogState State
|
||||
{
|
||||
get { return (AccountCreationDialogState)GetValue(StateProperty); }
|
||||
set { SetValue(StateProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty StateProperty = DependencyProperty.Register(nameof(State), typeof(AccountCreationDialogState), typeof(BaseAccountCreationDialog), new PropertyMetadata(AccountCreationDialogState.Idle, OnStateChanged));
|
||||
|
||||
// Prevent users from dismissing it by ESC key.
|
||||
private void DialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
|
||||
{
|
||||
if (args.Result == ContentDialogResult.None)
|
||||
{
|
||||
args.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowDialog()
|
||||
{
|
||||
_ = ShowAsync();
|
||||
}
|
||||
|
||||
public void Complete()
|
||||
{
|
||||
State = AccountCreationDialogState.Completed;
|
||||
|
||||
// Unregister from closing event.
|
||||
Closing -= DialogClosing;
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
private static void OnStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
if (obj is BaseAccountCreationDialog dialog)
|
||||
{
|
||||
dialog.UpdateState();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void UpdateState();
|
||||
}
|
||||
}
|
||||
29
Wino.Mail/Dialogs/ConfirmationDialog.xaml
Normal file
29
Wino.Mail/Dialogs/ConfirmationDialog.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.ConfirmationDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
Title="{x:Bind DialogTitle, Mode=OneWay}"
|
||||
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Closed="DialogClosed"
|
||||
PrimaryButtonText="{x:Bind ApproveButtonTitle, Mode=OneWay}"
|
||||
DefaultButton="Primary"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
PrimaryButtonClick="ApproveClicked"
|
||||
SecondaryButtonClick="CancelClicked"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">250</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxWidth">500</x:Double>
|
||||
<x:Double x:Key="ContentDialogMinHeight">200</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<TextBlock Text="{x:Bind Message, Mode=OneWay}" TextWrapping="Wrap" />
|
||||
</ContentDialog>
|
||||
80
Wino.Mail/Dialogs/ConfirmationDialog.xaml.cs
Normal file
80
Wino.Mail/Dialogs/ConfirmationDialog.xaml.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class ConfirmationDialog : ContentDialog, IConfirmationDialog
|
||||
{
|
||||
private TaskCompletionSource<bool> _completionSource;
|
||||
|
||||
#region Dependency Properties
|
||||
|
||||
public string DialogTitle
|
||||
{
|
||||
get { return (string)GetValue(DialogTitleProperty); }
|
||||
set { SetValue(DialogTitleProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DialogTitleProperty = DependencyProperty.Register(nameof(DialogTitle), typeof(string), typeof(ConfirmationDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return (string)GetValue(MessageProperty); }
|
||||
set { SetValue(MessageProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(nameof(Message), typeof(string), typeof(ConfirmationDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
public string ApproveButtonTitle
|
||||
{
|
||||
get { return (string)GetValue(ApproveButtonTitleProperty); }
|
||||
set { SetValue(ApproveButtonTitleProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ApproveButtonTitleProperty = DependencyProperty.Register(nameof(ApproveButtonTitle), typeof(string), typeof(ConfirmationDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
#endregion
|
||||
|
||||
private bool _isApproved;
|
||||
public ConfirmationDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public async Task<bool> ShowDialogAsync(string title, string message, string approveButtonTitle)
|
||||
{
|
||||
_completionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
DialogTitle = title;
|
||||
Message = message;
|
||||
ApproveButtonTitle = approveButtonTitle;
|
||||
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
ShowAsync();
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
|
||||
return await _completionSource.Task;
|
||||
}
|
||||
|
||||
private void DialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
|
||||
{
|
||||
_completionSource.TrySetResult(_isApproved);
|
||||
}
|
||||
|
||||
private void ApproveClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
_isApproved = true;
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
_isApproved = false;
|
||||
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Wino.Mail/Dialogs/CustomThemeBuilderDialog.xaml
Normal file
85
Wino.Mail/Dialogs/CustomThemeBuilderDialog.xaml
Normal file
@@ -0,0 +1,85 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.CustomThemeBuilderDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Wino.Dialogs"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||
FullSizeDesired="False"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
mc:Ignorable="d"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_ApplyTheme}"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonClick="ApplyClicked"
|
||||
Title="{x:Bind domain:Translator.CustomThemeBuilder_Title}">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">600</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
||||
<x:Double x:Key="ContentDialogMinHeight">200</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock x:Name="ErrorTextBlock" Foreground="Gold" />
|
||||
|
||||
<controls:SettingsCard Header="{x:Bind domain:Translator.CustomThemeBuilder_ThemeNameTitle}" Description="{x:Bind domain:Translator.CustomThemeBuilder_ThemeNameDescription}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<PathIcon Data="F1 M 10 0.625 C 10 0.45573 10.061849 0.309246 10.185547 0.185547 C 10.309244 0.06185 10.455729 0 10.625 0 L 15.625 0 C 15.79427 0 15.940754 0.06185 16.064453 0.185547 C 16.18815 0.309246 16.25 0.45573 16.25 0.625 C 16.25 0.794271 16.18815 0.940756 16.064453 1.064453 C 15.940754 1.188152 15.79427 1.25 15.625 1.25 L 13.75 1.25 L 13.75 18.75 L 15.625 18.75 C 15.79427 18.75 15.940754 18.81185 16.064453 18.935547 C 16.18815 19.059244 16.25 19.205729 16.25 19.375 C 16.25 19.544271 16.18815 19.690756 16.064453 19.814453 C 15.940754 19.93815 15.79427 20 15.625 20 L 10.625 20 C 10.455729 20 10.309244 19.93815 10.185547 19.814453 C 10.061849 19.690756 10 19.544271 10 19.375 C 10 19.205729 10.061849 19.059244 10.185547 18.935547 C 10.309244 18.81185 10.455729 18.75 10.625 18.75 L 12.5 18.75 L 12.5 1.25 L 10.625 1.25 C 10.455729 1.25 10.309244 1.188152 10.185547 1.064453 C 10.061849 0.940756 10 0.794271 10 0.625 Z M 0 6.25 C 0 5.735678 0.097656 5.250651 0.292969 4.794922 C 0.488281 4.339193 0.756836 3.94043 1.098633 3.598633 C 1.44043 3.256836 1.837565 2.988281 2.290039 2.792969 C 2.742513 2.597656 3.229167 2.5 3.75 2.5 L 11.25 2.5 L 11.25 3.75 L 3.75 3.75 C 3.404948 3.75 3.081055 3.815105 2.77832 3.945312 C 2.475586 4.075521 2.210286 4.254558 1.982422 4.482422 C 1.754557 4.710287 1.575521 4.975587 1.445312 5.27832 C 1.315104 5.581056 1.25 5.904949 1.25 6.25 L 1.25 13.75 C 1.25 14.095053 1.315104 14.418945 1.445312 14.72168 C 1.575521 15.024414 1.754557 15.289714 1.982422 15.517578 C 2.210286 15.745443 2.475586 15.924479 2.77832 16.054688 C 3.081055 16.184896 3.404948 16.25 3.75 16.25 L 11.25 16.25 L 11.25 17.5 L 3.75 17.5 C 3.229167 17.5 2.742513 17.402344 2.290039 17.207031 C 1.837565 17.011719 1.44043 16.743164 1.098633 16.401367 C 0.756836 16.05957 0.488281 15.662436 0.292969 15.209961 C 0.097656 14.757487 0 14.270834 0 13.75 Z M 15 3.75 L 15 2.5 L 16.25 2.5 C 16.764322 2.5 17.249348 2.597656 17.705078 2.792969 C 18.160807 2.988281 18.55957 3.256836 18.901367 3.598633 C 19.243164 3.94043 19.511719 4.339193 19.707031 4.794922 C 19.902344 5.250651 20 5.735678 20 6.25 L 20 13.75 C 20 14.270834 19.902344 14.757487 19.707031 15.209961 C 19.511719 15.662436 19.243164 16.05957 18.901367 16.401367 C 18.55957 16.743164 18.160807 17.011719 17.705078 17.207031 C 17.249348 17.402344 16.764322 17.5 16.25 17.5 L 15 17.5 L 15 16.25 L 16.25 16.25 C 16.595051 16.25 16.918945 16.184896 17.22168 16.054688 C 17.524414 15.924479 17.789713 15.745443 18.017578 15.517578 C 18.245441 15.289714 18.424479 15.024414 18.554688 14.72168 C 18.684895 14.418945 18.75 14.095053 18.75 13.75 L 18.75 6.25 C 18.75 5.904949 18.684895 5.581056 18.554688 5.27832 C 18.424479 4.975587 18.245441 4.710287 18.017578 4.482422 C 17.789713 4.254558 17.524414 4.075521 17.22168 3.945312 C 16.918945 3.815105 16.595051 3.75 16.25 3.75 Z M 7.441406 5.361328 C 7.389323 5.250651 7.312825 5.162761 7.211914 5.097656 C 7.111002 5.032553 6.998697 5.000001 6.875 5 C 6.751302 5.000001 6.638997 5.032553 6.538086 5.097656 C 6.437174 5.162761 6.360677 5.250651 6.308594 5.361328 L 2.871094 12.861328 C 2.799479 13.017578 2.792969 13.177084 2.851562 13.339844 C 2.910156 13.502604 3.017578 13.619792 3.173828 13.691406 C 3.330078 13.763021 3.489583 13.769531 3.652344 13.710938 C 3.815104 13.652344 3.932292 13.544922 4.003906 13.388672 L 4.84375 11.5625 L 8.896484 11.5625 L 8.90625 11.5625 L 9.746094 13.388672 C 9.817708 13.544922 9.934896 13.652344 10.097656 13.710938 C 10.260416 13.769531 10.419922 13.763021 10.576172 13.691406 C 10.732422 13.619792 10.839844 13.502604 10.898438 13.339844 C 10.957031 13.177084 10.950521 13.017578 10.878906 12.861328 Z M 5.410156 10.3125 L 6.875 7.128906 L 8.339844 10.3125 Z " />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
<controls:SettingsCard.Content>
|
||||
<TextBox x:Name="ThemeNameBox" />
|
||||
</controls:SettingsCard.Content>
|
||||
</controls:SettingsCard>
|
||||
|
||||
<controls:SettingsCard
|
||||
Header="{x:Bind domain:Translator.CustomThemeBuilder_WallpaperTitle}"
|
||||
x:Name="CustomWallpaperCard"
|
||||
Description="{x:Bind domain:Translator.CustomThemeBuilder_WallpaperDescription}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<PathIcon Data="F1 M 4.921875 16.25 C 4.433594 16.25 3.966471 16.150717 3.520508 15.952148 C 3.074544 15.753581 2.683919 15.486654 2.348633 15.151367 C 2.013346 14.816081 1.746419 14.425456 1.547852 13.979492 C 1.349284 13.533529 1.25 13.066406 1.25 12.578125 L 1.25 4.921875 C 1.25 4.433594 1.349284 3.966473 1.547852 3.520508 C 1.746419 3.074545 2.013346 2.68392 2.348633 2.348633 C 2.683919 2.013348 3.074544 1.74642 3.520508 1.547852 C 3.966471 1.349285 4.433594 1.25 4.921875 1.25 L 12.578125 1.25 C 13.066406 1.25 13.533528 1.349285 13.979492 1.547852 C 14.425455 1.74642 14.81608 2.013348 15.151367 2.348633 C 15.486653 2.68392 15.75358 3.074545 15.952148 3.520508 C 16.150715 3.966473 16.25 4.433594 16.25 4.921875 L 16.25 12.578125 C 16.25 13.066406 16.150715 13.533529 15.952148 13.979492 C 15.75358 14.425456 15.486653 14.816081 15.151367 15.151367 C 14.81608 15.486654 14.425455 15.753581 13.979492 15.952148 C 13.533528 16.150717 13.066406 16.25 12.578125 16.25 Z M 8.75 8.90625 C 9.082031 8.90625 9.401041 8.969727 9.707031 9.09668 C 10.013021 9.223633 10.283203 9.404297 10.517578 9.638672 L 14.658203 13.769531 C 14.768879 13.580729 14.853515 13.377279 14.912109 13.15918 C 14.970702 12.941081 14.999999 12.721354 15 12.5 L 15 4.951172 C 14.999999 4.625651 14.933268 4.314779 14.799805 4.018555 C 14.666341 3.722332 14.487305 3.461914 14.262695 3.237305 C 14.038086 3.012695 13.777669 2.83366 13.481445 2.700195 C 13.185221 2.566732 12.874348 2.5 12.548828 2.5 L 4.951172 2.5 C 4.625651 2.5 4.314778 2.566732 4.018555 2.700195 C 3.722331 2.83366 3.461914 3.012695 3.237305 3.237305 C 3.012695 3.461914 2.833659 3.722332 2.700195 4.018555 C 2.566732 4.314779 2.5 4.625651 2.5 4.951172 L 2.5 12.5 C 2.5 12.721354 2.529297 12.941081 2.587891 13.15918 C 2.646484 13.377279 2.73112 13.580729 2.841797 13.769531 L 6.982422 9.638672 C 7.216797 9.404297 7.486979 9.223633 7.792969 9.09668 C 8.098958 8.969727 8.417969 8.90625 8.75 8.90625 Z M 10.625 5.625 C 10.625 5.449219 10.657552 5.286459 10.722656 5.136719 C 10.78776 4.98698 10.877278 4.855145 10.991211 4.741211 C 11.105143 4.627279 11.236979 4.537761 11.386719 4.472656 C 11.536458 4.407553 11.699219 4.375 11.875 4.375 C 12.04427 4.375 12.205402 4.407553 12.358398 4.472656 C 12.511393 4.537761 12.644856 4.627279 12.758789 4.741211 C 12.872721 4.855145 12.962239 4.988607 13.027344 5.141602 C 13.092447 5.294597 13.124999 5.455729 13.125 5.625 C 13.124999 5.800781 13.092447 5.963542 13.027344 6.113281 C 12.962239 6.263021 12.872721 6.394857 12.758789 6.508789 C 12.644856 6.622722 12.513021 6.71224 12.363281 6.777344 C 12.213541 6.842449 12.050781 6.875001 11.875 6.875 C 11.699219 6.875001 11.53483 6.842449 11.381836 6.777344 C 11.228841 6.71224 11.097005 6.62435 10.986328 6.513672 C 10.87565 6.402996 10.78776 6.27116 10.722656 6.118164 C 10.657552 5.96517 10.625 5.800781 10.625 5.625 Z M 7.5 18.75 C 6.966146 18.75 6.455078 18.642578 5.966797 18.427734 C 5.478516 18.212891 5.058594 17.903646 4.707031 17.5 L 13.193359 17.5 C 13.785807 17.5 14.344075 17.382812 14.868164 17.148438 C 15.392252 16.914062 15.849609 16.59668 16.240234 16.196289 C 16.630859 15.795898 16.938477 15.332031 17.163086 14.804688 C 17.387695 14.277344 17.5 13.717448 17.5 13.125 L 17.5 4.707031 C 17.903645 5.058595 18.212891 5.478517 18.427734 5.966797 C 18.642578 6.455079 18.75 6.966146 18.75 7.5 L 18.75 13.125 C 18.75 13.89974 18.601887 14.628906 18.305664 15.3125 C 18.009439 15.996094 17.607422 16.591797 17.099609 17.099609 C 16.591797 17.607422 15.996094 18.009439 15.3125 18.305664 C 14.628906 18.601889 13.899739 18.75 13.125 18.75 Z M 12.5 15 C 12.721354 15 12.94108 14.970703 13.15918 14.912109 C 13.377278 14.853516 13.580729 14.768881 13.769531 14.658203 L 9.638672 10.517578 C 9.391275 10.270183 9.095052 10.146484 8.75 10.146484 C 8.404947 10.146484 8.108724 10.270183 7.861328 10.517578 L 3.730469 14.658203 C 3.919271 14.768881 4.122721 14.853516 4.34082 14.912109 C 4.558919 14.970703 4.778646 15 5 15 Z " />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
<controls:SettingsCard.Content>
|
||||
<Button Content="{x:Bind domain:Translator.Buttons_Browse}" Click="BrowseWallpaperClicked" />
|
||||
</controls:SettingsCard.Content>
|
||||
</controls:SettingsCard>
|
||||
|
||||
<controls:SettingsCard Header="{x:Bind domain:Translator.CustomThemeBuilder_AccentColorTitle}" Description="{x:Bind domain:Translator.CustomThemeBuilder_AccentColorDescription}">
|
||||
<controls:SettingsCard.HeaderIcon>
|
||||
<PathIcon Data="F1 M 4.921875 16.25 C 4.433594 16.25 3.966471 16.150717 3.520508 15.952148 C 3.074544 15.753581 2.683919 15.486654 2.348633 15.151367 C 2.013346 14.816081 1.746419 14.425456 1.547852 13.979492 C 1.349284 13.533529 1.25 13.066406 1.25 12.578125 L 1.25 4.921875 C 1.25 4.433594 1.349284 3.966473 1.547852 3.520508 C 1.746419 3.074545 2.013346 2.68392 2.348633 2.348633 C 2.683919 2.013348 3.074544 1.74642 3.520508 1.547852 C 3.966471 1.349285 4.433594 1.25 4.921875 1.25 L 12.578125 1.25 C 13.066406 1.25 13.533528 1.349285 13.979492 1.547852 C 14.425455 1.74642 14.81608 2.013348 15.151367 2.348633 C 15.486653 2.68392 15.75358 3.074545 15.952148 3.520508 C 16.150715 3.966473 16.25 4.433594 16.25 4.921875 L 16.25 12.578125 C 16.25 13.066406 16.150715 13.533529 15.952148 13.979492 C 15.75358 14.425456 15.486653 14.816081 15.151367 15.151367 C 14.81608 15.486654 14.425455 15.753581 13.979492 15.952148 C 13.533528 16.150717 13.066406 16.25 12.578125 16.25 Z M 8.75 8.90625 C 9.082031 8.90625 9.401041 8.969727 9.707031 9.09668 C 10.013021 9.223633 10.283203 9.404297 10.517578 9.638672 L 14.658203 13.769531 C 14.768879 13.580729 14.853515 13.377279 14.912109 13.15918 C 14.970702 12.941081 14.999999 12.721354 15 12.5 L 15 4.951172 C 14.999999 4.625651 14.933268 4.314779 14.799805 4.018555 C 14.666341 3.722332 14.487305 3.461914 14.262695 3.237305 C 14.038086 3.012695 13.777669 2.83366 13.481445 2.700195 C 13.185221 2.566732 12.874348 2.5 12.548828 2.5 L 4.951172 2.5 C 4.625651 2.5 4.314778 2.566732 4.018555 2.700195 C 3.722331 2.83366 3.461914 3.012695 3.237305 3.237305 C 3.012695 3.461914 2.833659 3.722332 2.700195 4.018555 C 2.566732 4.314779 2.5 4.625651 2.5 4.951172 L 2.5 12.5 C 2.5 12.721354 2.529297 12.941081 2.587891 13.15918 C 2.646484 13.377279 2.73112 13.580729 2.841797 13.769531 L 6.982422 9.638672 C 7.216797 9.404297 7.486979 9.223633 7.792969 9.09668 C 8.098958 8.969727 8.417969 8.90625 8.75 8.90625 Z M 10.625 5.625 C 10.625 5.449219 10.657552 5.286459 10.722656 5.136719 C 10.78776 4.98698 10.877278 4.855145 10.991211 4.741211 C 11.105143 4.627279 11.236979 4.537761 11.386719 4.472656 C 11.536458 4.407553 11.699219 4.375 11.875 4.375 C 12.04427 4.375 12.205402 4.407553 12.358398 4.472656 C 12.511393 4.537761 12.644856 4.627279 12.758789 4.741211 C 12.872721 4.855145 12.962239 4.988607 13.027344 5.141602 C 13.092447 5.294597 13.124999 5.455729 13.125 5.625 C 13.124999 5.800781 13.092447 5.963542 13.027344 6.113281 C 12.962239 6.263021 12.872721 6.394857 12.758789 6.508789 C 12.644856 6.622722 12.513021 6.71224 12.363281 6.777344 C 12.213541 6.842449 12.050781 6.875001 11.875 6.875 C 11.699219 6.875001 11.53483 6.842449 11.381836 6.777344 C 11.228841 6.71224 11.097005 6.62435 10.986328 6.513672 C 10.87565 6.402996 10.78776 6.27116 10.722656 6.118164 C 10.657552 5.96517 10.625 5.800781 10.625 5.625 Z M 7.5 18.75 C 6.966146 18.75 6.455078 18.642578 5.966797 18.427734 C 5.478516 18.212891 5.058594 17.903646 4.707031 17.5 L 13.193359 17.5 C 13.785807 17.5 14.344075 17.382812 14.868164 17.148438 C 15.392252 16.914062 15.849609 16.59668 16.240234 16.196289 C 16.630859 15.795898 16.938477 15.332031 17.163086 14.804688 C 17.387695 14.277344 17.5 13.717448 17.5 13.125 L 17.5 4.707031 C 17.903645 5.058595 18.212891 5.478517 18.427734 5.966797 C 18.642578 6.455079 18.75 6.966146 18.75 7.5 L 18.75 13.125 C 18.75 13.89974 18.601887 14.628906 18.305664 15.3125 C 18.009439 15.996094 17.607422 16.591797 17.099609 17.099609 C 16.591797 17.607422 15.996094 18.009439 15.3125 18.305664 C 14.628906 18.601889 13.899739 18.75 13.125 18.75 Z M 12.5 15 C 12.721354 15 12.94108 14.970703 13.15918 14.912109 C 13.377278 14.853516 13.580729 14.768881 13.769531 14.658203 L 9.638672 10.517578 C 9.391275 10.270183 9.095052 10.146484 8.75 10.146484 C 8.404947 10.146484 8.108724 10.270183 7.861328 10.517578 L 3.730469 14.658203 C 3.919271 14.768881 4.122721 14.853516 4.34082 14.912109 C 4.558919 14.970703 4.778646 15 5 15 Z " />
|
||||
</controls:SettingsCard.HeaderIcon>
|
||||
<controls:SettingsCard.Content>
|
||||
<Button>
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
<TextBlock Text="{x:Bind domain:Translator.CustomThemeBuilder_PickColor}" />
|
||||
|
||||
<Grid
|
||||
x:Name="PreviewAccentColorGrid"
|
||||
Width="20"
|
||||
Background="{ThemeResource SystemAccentColor}"
|
||||
Height="20" />
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="Bottom">
|
||||
<muxc:ColorPicker
|
||||
ColorSpectrumShape="Box"
|
||||
ColorChanged="PickerColorChanged"
|
||||
IsColorChannelTextInputVisible="False"
|
||||
IsHexInputVisible="False"
|
||||
IsAlphaEnabled="False"
|
||||
IsAlphaSliderVisible="False"
|
||||
IsAlphaTextInputVisible="False" />
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
</controls:SettingsCard.Content>
|
||||
</controls:SettingsCard>
|
||||
</StackPanel>
|
||||
</ContentDialog>
|
||||
65
Wino.Mail/Dialogs/CustomThemeBuilderDialog.xaml.cs
Normal file
65
Wino.Mail/Dialogs/CustomThemeBuilderDialog.xaml.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using CommunityToolkit.WinUI.Helpers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Services;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class CustomThemeBuilderDialog : ContentDialog
|
||||
{
|
||||
public byte[] WallpaperData { get; private set; }
|
||||
public string AccentColor { get; private set; }
|
||||
|
||||
private IThemeService _themeService;
|
||||
|
||||
public CustomThemeBuilderDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_themeService = App.Current.Services.GetService<IThemeService>();
|
||||
}
|
||||
|
||||
private async void ApplyClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
if (Array.Empty<byte>() == WallpaperData)
|
||||
return;
|
||||
|
||||
var deferal = args.GetDeferral();
|
||||
|
||||
try
|
||||
{
|
||||
await _themeService.CreateNewCustomThemeAsync(ThemeNameBox.Text, AccentColor, WallpaperData);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
ErrorTextBlock.Text = exception.Message;
|
||||
}
|
||||
finally
|
||||
{
|
||||
deferal.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
private async void BrowseWallpaperClicked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
var dialogService = App.Current.Services.GetService<IDialogService>();
|
||||
|
||||
var pickedFileData = await dialogService.PickWindowsFileContentAsync(".jpg", ".png");
|
||||
|
||||
if (pickedFileData == Array.Empty<byte>()) return;
|
||||
|
||||
IsPrimaryButtonEnabled = true;
|
||||
|
||||
WallpaperData = pickedFileData;
|
||||
}
|
||||
|
||||
private void PickerColorChanged(Microsoft.UI.Xaml.Controls.ColorPicker sender, Microsoft.UI.Xaml.Controls.ColorChangedEventArgs args)
|
||||
{
|
||||
PreviewAccentColorGrid.Background = new SolidColorBrush(args.NewColor);
|
||||
AccentColor = args.NewColor.ToHex();
|
||||
}
|
||||
}
|
||||
}
|
||||
59
Wino.Mail/Dialogs/MoveMailDialog.xaml
Normal file
59
Wino.Mail/Dialogs/MoveMailDialog.xaml
Normal file
@@ -0,0 +1,59 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.MoveMailDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:folders="using:Wino.Core.Domain.Models.Folders"
|
||||
Title="{x:Bind domain:Translator.MoveMailDialog_Title}"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonClick="CancelClicked"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">600</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxWidth">600</x:Double>
|
||||
<x:Double x:Key="ContentDialogMinHeight">756</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||
|
||||
<DataTemplate x:Key="FolderStructureMenuFlyoutItemTemplate" x:DataType="folders:IMailItemFolder">
|
||||
<muxc:TreeViewItem ItemsSource="{x:Bind ChildFolders}" IsExpanded="True">
|
||||
<StackPanel
|
||||
Height="32"
|
||||
Orientation="Horizontal"
|
||||
Spacing="12">
|
||||
<controls:WinoFontIcon FontSize="20" Icon="{x:Bind helpers:XamlHelpers.GetSpecialFolderPathIconGeometry(SpecialFolderType)}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{x:Bind FolderName}" />
|
||||
</StackPanel>
|
||||
</muxc:TreeViewItem>
|
||||
</DataTemplate>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
x:Name="InvalidFolderText"
|
||||
Margin="0,0,0,6"
|
||||
Visibility="Collapsed"
|
||||
Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}" />
|
||||
|
||||
<muxc:TreeView
|
||||
x:Name="FolderTreeView"
|
||||
Grid.Row="1"
|
||||
CanDragItems="False"
|
||||
SelectedItem="{x:Bind SelectedFolder, Mode=TwoWay}"
|
||||
ItemTemplate="{StaticResource FolderStructureMenuFlyoutItemTemplate}"
|
||||
ItemsSource="{x:Bind FolderList, Mode=OneWay}"
|
||||
SelectionMode="Single" />
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
75
Wino.Mail/Dialogs/MoveMailDialog.xaml.cs
Normal file
75
Wino.Mail/Dialogs/MoveMailDialog.xaml.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Models.Folders;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class MoveMailDialog : ContentDialog
|
||||
{
|
||||
public IMailItemFolder SelectedFolder
|
||||
{
|
||||
get { return (IMailItemFolder)GetValue(SelectedFolderProperty); }
|
||||
set { SetValue(SelectedFolderProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SelectedFolderProperty = DependencyProperty.Register(nameof(SelectedFolder), typeof(IMailItemFolder), typeof(MoveMailDialog), new PropertyMetadata(null, OnSelectedFolderChanged));
|
||||
|
||||
|
||||
public List<IMailItemFolder> FolderList { get; set; }
|
||||
|
||||
public MoveMailDialog(List<IMailItemFolder> allFolders)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (allFolders == null) return;
|
||||
|
||||
FolderList = allFolders;
|
||||
}
|
||||
|
||||
private static void OnSelectedFolderChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
if (obj is MoveMailDialog dialog)
|
||||
{
|
||||
dialog.VerifySelection();
|
||||
}
|
||||
}
|
||||
|
||||
private void VerifySelection()
|
||||
{
|
||||
if (SelectedFolder != null)
|
||||
{
|
||||
// Don't select non-move capable folders like Categories or More.
|
||||
|
||||
if (!SelectedFolder.IsMoveTarget)
|
||||
{
|
||||
// Warn users for only proper mail folders. Not ghost folders.
|
||||
InvalidFolderText.Visibility = Visibility.Visible;
|
||||
InvalidFolderText.Text = string.Format(Translator.MoveMailDialog_InvalidFolderMessage, SelectedFolder.FolderName);
|
||||
|
||||
if (FolderTreeView.SelectedItem != null)
|
||||
{
|
||||
// Toggle the expansion for the selected container if available.
|
||||
// I don't like the expand arrow touch area. It's better this way.
|
||||
|
||||
if (FolderTreeView.ContainerFromItem(FolderTreeView.SelectedItem) is Microsoft.UI.Xaml.Controls.TreeViewItem container)
|
||||
{
|
||||
container.IsExpanded = !container.IsExpanded;
|
||||
}
|
||||
}
|
||||
SelectedFolder = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
79
Wino.Mail/Dialogs/NewAccountDialog.xaml
Normal file
79
Wino.Mail/Dialogs/NewAccountDialog.xaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.NewAccountDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:accounts="using:Wino.Core.Domain.Models.Accounts"
|
||||
Title="{x:Bind domain:Translator.NewAccountDialog_Title}"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
Opened="DialogOpened"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
PrimaryButtonClick="CreateClicked"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_CreateAccount}"
|
||||
SecondaryButtonClick="CancelClicked"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<DataTemplate x:Key="NewMailProviderTemplate" x:DataType="accounts:ProviderDetail">
|
||||
<Grid Padding="6" Margin="0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="35"
|
||||
Height="35"
|
||||
Source="{x:Bind ProviderImage}" />
|
||||
<StackPanel
|
||||
Spacing="2"
|
||||
Grid.Column="1"
|
||||
Margin="12,0"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock FontWeight="Bold" Text="{x:Bind Name}" />
|
||||
<TextBlock Text="{x:Bind Description}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<Grid MinWidth="400">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Info panel -->
|
||||
<TextBox
|
||||
x:Name="AccountNameTextbox"
|
||||
Header="{x:Bind domain:Translator.NewAccountDialog_AccountName}"
|
||||
Text="{x:Bind domain:Translator.NewAccountDialog_AccountNameDefaultValue}"
|
||||
PlaceholderText="{x:Bind domain:Translator.NewAccountDialog_AccountNamePlaceholder}"
|
||||
TextChanged="AccountNameChanged" />
|
||||
|
||||
<!-- TODO -->
|
||||
<!--<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Color" />
|
||||
<muxc:ColorPicker x:Name="AccountColorPicker" Grid.Column="1" />
|
||||
</Grid>-->
|
||||
|
||||
<ListView
|
||||
Grid.Row="2"
|
||||
Margin="0,12"
|
||||
Padding="0"
|
||||
ItemTemplate="{StaticResource NewMailProviderTemplate}"
|
||||
ItemsSource="{x:Bind Providers}"
|
||||
SelectedItem="{x:Bind SelectedMailProvider, Mode=TwoWay}"
|
||||
SelectionMode="Single" />
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
79
Wino.Mail/Dialogs/NewAccountDialog.xaml.cs
Normal file
79
Wino.Mail/Dialogs/NewAccountDialog.xaml.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class NewAccountDialog : ContentDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets current selected mail provider in the dialog.
|
||||
/// </summary>
|
||||
public ProviderDetail SelectedMailProvider
|
||||
{
|
||||
get { return (ProviderDetail)GetValue(SelectedMailProviderProperty); }
|
||||
set { SetValue(SelectedMailProviderProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SelectedMailProviderProperty = DependencyProperty.Register(nameof(SelectedMailProvider), typeof(ProviderDetail), typeof(NewAccountDialog), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedProviderChanged)));
|
||||
|
||||
// List of available mail providers for now.
|
||||
|
||||
public List<IProviderDetail> Providers { get; set; }
|
||||
|
||||
public Tuple<string, MailProviderType> AccountInformationTuple = null;
|
||||
|
||||
public NewAccountDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// AccountColorPicker.Color = Colors.Blue;
|
||||
}
|
||||
|
||||
private static void OnSelectedProviderChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
if (obj is NewAccountDialog dialog)
|
||||
dialog.ValidateCreateButton();
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void CreateClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
ValidateCreateButton();
|
||||
|
||||
if (IsSecondaryButtonEnabled)
|
||||
{
|
||||
AccountInformationTuple = new Tuple<string, MailProviderType>(AccountNameTextbox.Text.Trim(), SelectedMailProvider.Type);
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void AccountNameChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
ValidateCreateButton();
|
||||
}
|
||||
|
||||
// Returns whether we can create account or not.
|
||||
private void ValidateCreateButton()
|
||||
{
|
||||
bool shouldEnable = SelectedMailProvider != null
|
||||
&& SelectedMailProvider.IsSupported
|
||||
&& !string.IsNullOrEmpty(AccountNameTextbox.Text);
|
||||
|
||||
IsPrimaryButtonEnabled = shouldEnable;
|
||||
}
|
||||
|
||||
private void DialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
|
||||
{
|
||||
ValidateCreateButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Wino.Mail/Dialogs/NewImapSetupDialog.xaml
Normal file
25
Wino.Mail/Dialogs/NewImapSetupDialog.xaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.NewImapSetupDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Wino.Dialogs"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
DefaultButton="Secondary"
|
||||
Closing="OnDialogClosing"
|
||||
Closed="ImapSetupDialogClosed"
|
||||
Opened="ImapSetupDialogOpened"
|
||||
FullSizeDesired="False"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<Thickness x:Key="ContentDialogPadding">0,0,0,0</Thickness>
|
||||
<!--<x:Double x:Key="ContentDialogMinWidth">768</x:Double>-->
|
||||
<x:Double x:Key="ContentDialogMaxWidth">1920</x:Double>
|
||||
<!--<x:Double x:Key="ContentDialogMinHeight">768</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">2000</x:Double>-->
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<Frame x:Name="ImapFrame" />
|
||||
</ContentDialog>
|
||||
79
Wino.Mail/Dialogs/NewImapSetupDialog.xaml.cs
Normal file
79
Wino.Mail/Dialogs/NewImapSetupDialog.xaml.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
using Wino.Core.Domain.Entities;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Messages.Mails;
|
||||
using Wino.Views.ImapSetup;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public enum ImapSetupState
|
||||
{
|
||||
Welcome,
|
||||
AutoDiscovery,
|
||||
TestingConnection,
|
||||
PreparingFolder
|
||||
}
|
||||
|
||||
public sealed partial class NewImapSetupDialog : ContentDialog,
|
||||
IRecipient<ImapSetupNavigationRequested>,
|
||||
IRecipient<ImapSetupBackNavigationRequested>,
|
||||
IRecipient<ImapSetupDismissRequested>,
|
||||
ICustomServerAccountCreationDialog
|
||||
{
|
||||
private TaskCompletionSource<CustomServerInformation> _getServerInfoTaskCompletionSource = new TaskCompletionSource<CustomServerInformation>();
|
||||
|
||||
private bool isDismissRequested = false;
|
||||
|
||||
public NewImapSetupDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ImapFrame.Navigate(typeof(WelcomeImapSetupPage), null, new DrillInNavigationTransitionInfo());
|
||||
}
|
||||
|
||||
// Not used for now.
|
||||
public AccountCreationDialogState State { get; set; }
|
||||
|
||||
public void Complete()
|
||||
{
|
||||
if (!_getServerInfoTaskCompletionSource.Task.IsCompleted)
|
||||
_getServerInfoTaskCompletionSource.TrySetResult(null);
|
||||
|
||||
isDismissRequested = true;
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
public Task<CustomServerInformation> GetCustomServerInformationAsync() => _getServerInfoTaskCompletionSource.Task;
|
||||
|
||||
public void Receive(ImapSetupBackNavigationRequested message)
|
||||
{
|
||||
ImapFrame.Navigate(message.PageType, message.Parameter, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromLeft });
|
||||
}
|
||||
|
||||
public void Receive(ImapSetupNavigationRequested message)
|
||||
{
|
||||
ImapFrame.Navigate(message.PageType, message.Parameter, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight });
|
||||
}
|
||||
|
||||
public void Receive(ImapSetupDismissRequested message) => _getServerInfoTaskCompletionSource.TrySetResult(message.CompletedServerInformation);
|
||||
|
||||
public void ShowDialog() => _ = ShowAsync();
|
||||
|
||||
public void ShowPreparingFolders()
|
||||
{
|
||||
ImapFrame.Navigate(typeof(PreparingImapFoldersPage), new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromLeft });
|
||||
}
|
||||
|
||||
private void ImapSetupDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args) => WeakReferenceMessenger.Default.UnregisterAll(this);
|
||||
|
||||
private void ImapSetupDialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args) => WeakReferenceMessenger.Default.RegisterAll(this);
|
||||
|
||||
// Don't hide the dialog unless dismiss is requested from the inner pages specifically.
|
||||
private void OnDialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args) => args.Cancel = !isDismissRequested;
|
||||
}
|
||||
}
|
||||
24
Wino.Mail/Dialogs/StoreRatingDialog.xaml
Normal file
24
Wino.Mail/Dialogs/StoreRatingDialog.xaml
Normal file
@@ -0,0 +1,24 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.StoreRatingDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Wino.Dialogs"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_RateWino}"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_No}"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonClick="RateClicked"
|
||||
Title="{x:Bind domain:Translator.StoreRatingDialog_Title}"
|
||||
Style="{StaticResource WinoDialogStyle}">
|
||||
|
||||
<Grid>
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Text="{x:Bind domain:Translator.StoreRatingDialog_MessageFirstLine}" />
|
||||
<TextBlock Text="{x:Bind domain:Translator.StoreRatingDialog_MessageSecondLine}" />
|
||||
<CheckBox IsChecked="{x:Bind DontAskAgain, Mode=TwoWay}" Content="{x:Bind domain:Translator.Dialog_DontAskAgain}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
21
Wino.Mail/Dialogs/StoreRatingDialog.xaml.cs
Normal file
21
Wino.Mail/Dialogs/StoreRatingDialog.xaml.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class StoreRatingDialog : ContentDialog, IStoreRatingDialog
|
||||
{
|
||||
public bool DontAskAgain { get; set; }
|
||||
public bool RateWinoClicked { get; set; }
|
||||
|
||||
public StoreRatingDialog()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
private void RateClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
RateWinoClicked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
99
Wino.Mail/Dialogs/SystemFolderConfigurationDialog.xaml
Normal file
99
Wino.Mail/Dialogs/SystemFolderConfigurationDialog.xaml
Normal file
@@ -0,0 +1,99 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.SystemFolderConfigurationDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:controls1="using:CommunityToolkit.WinUI.Controls"
|
||||
mc:Ignorable="d"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
DefaultButton="Primary"
|
||||
IsPrimaryButtonEnabled="True"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
PrimaryButtonText="Save Configuration"
|
||||
PrimaryButtonClick="SaveClicked"
|
||||
Closing="DialogClosing"
|
||||
SecondaryButtonClick="CancelClicked"
|
||||
Title="{x:Bind domain:Translator.SettingsConfigureSpecialFolders_Title}">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<Style TargetType="ComboBox">
|
||||
<Setter Property="Width" Value="100" />
|
||||
</Style>
|
||||
</ContentDialog.Resources>
|
||||
<ScrollViewer>
|
||||
<Grid RowSpacing="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
|
||||
<Run Text="{x:Bind domain:Translator.SystemFolderConfigDialog_MessageFirstLine}" />
|
||||
<LineBreak />
|
||||
<LineBreak />
|
||||
<Run
|
||||
Text="{x:Bind domain:Translator.SystemFolderConfigDialog_MessageSecondLine}"
|
||||
Foreground="{StaticResource SystemErrorTextColor}"
|
||||
FontWeight="SemiBold" />
|
||||
</TextBlock>
|
||||
|
||||
<StackPanel Grid.Row="1" Spacing="6">
|
||||
<controls1:SettingsCard
|
||||
x:Name="SentCard"
|
||||
Header="{x:Bind domain:Translator.SystemFolderConfigDialog_SentFolderHeader}"
|
||||
Description="{x:Bind domain:Translator.SystemFolderConfigDialog_SentFolderDescription}">
|
||||
<controls1:SettingsCard.HeaderIcon>
|
||||
<controls:WinoFontIcon FontSize="16" Icon="SpecialFolderSent" />
|
||||
</controls1:SettingsCard.HeaderIcon>
|
||||
<ComboBox SelectedItem="{x:Bind Sent, Mode=TwoWay}" ItemsSource="{x:Bind AvailableFolders}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
<controls1:SettingsCard
|
||||
x:Name="DraftCard"
|
||||
Header="{x:Bind domain:Translator.SystemFolderConfigDialog_DraftFolderHeader}"
|
||||
Description="{x:Bind domain:Translator.SystemFolderConfigDialog_DraftFolderDescription}">
|
||||
<controls1:SettingsCard.HeaderIcon>
|
||||
<controls:WinoFontIcon FontSize="16" Icon="SpecialFolderDraft" />
|
||||
</controls1:SettingsCard.HeaderIcon>
|
||||
<ComboBox SelectedItem="{x:Bind Draft, Mode=TwoWay}" ItemsSource="{x:Bind AvailableFolders}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
<controls1:SettingsCard
|
||||
x:Name="ArchiveCard"
|
||||
Header="{x:Bind domain:Translator.SystemFolderConfigDialog_ArchiveFolderHeader}"
|
||||
Description="{x:Bind domain:Translator.SystemFolderConfigDialog_ArchiveFolderDescription}">
|
||||
<controls1:SettingsCard.HeaderIcon>
|
||||
<controls:WinoFontIcon FontSize="16" Icon="SpecialFolderArchive" />
|
||||
</controls1:SettingsCard.HeaderIcon>
|
||||
<ComboBox SelectedItem="{x:Bind Archive, Mode=TwoWay}" ItemsSource="{x:Bind AvailableFolders}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
<controls1:SettingsCard
|
||||
x:Name="DeletedCard"
|
||||
Header="{x:Bind domain:Translator.SystemFolderConfigDialog_DeletedFolderHeader}"
|
||||
Description="{x:Bind domain:Translator.SystemFolderConfigDialog_DeletedFolderDescription}">
|
||||
<controls1:SettingsCard.HeaderIcon>
|
||||
<controls:WinoFontIcon FontSize="16" Icon="SpecialFolderDeleted" />
|
||||
</controls1:SettingsCard.HeaderIcon>
|
||||
<ComboBox SelectedItem="{x:Bind Trash, Mode=TwoWay}" ItemsSource="{x:Bind AvailableFolders}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
<controls1:SettingsCard
|
||||
x:Name="JunkCard"
|
||||
Header="{x:Bind domain:Translator.SystemFolderConfigDialog_JunkFolderHeader}"
|
||||
Description="{x:Bind domain:Translator.SystemFolderConfigDialog_JunkFolderDescription}">
|
||||
<controls1:SettingsCard.HeaderIcon>
|
||||
<controls:WinoFontIcon FontSize="16" Icon="SpecialFolderJunk" />
|
||||
</controls1:SettingsCard.HeaderIcon>
|
||||
<ComboBox SelectedItem="{x:Bind Junk, Mode=TwoWay}" ItemsSource="{x:Bind AvailableFolders}" />
|
||||
</controls1:SettingsCard>
|
||||
|
||||
<TextBlock x:Name="ValidationErrorTextBlock" Foreground="{StaticResource SystemErrorTextColor}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ContentDialog>
|
||||
|
||||
71
Wino.Mail/Dialogs/SystemFolderConfigurationDialog.xaml.cs
Normal file
71
Wino.Mail/Dialogs/SystemFolderConfigurationDialog.xaml.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Exceptions;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class SystemFolderConfigurationDialog : ContentDialog
|
||||
{
|
||||
private bool canDismissDialog = false;
|
||||
|
||||
public SystemFolderConfiguration Configuration { get; set; }
|
||||
public List<MailItemFolder> AvailableFolders { get; }
|
||||
|
||||
public MailItemFolder Sent { get; set; }
|
||||
public MailItemFolder Draft { get; set; }
|
||||
public MailItemFolder Archive { get; set; }
|
||||
public MailItemFolder Junk { get; set; }
|
||||
public MailItemFolder Trash { get; set; }
|
||||
|
||||
public SystemFolderConfigurationDialog(List<MailItemFolder> availableFolders)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
AvailableFolders = availableFolders;
|
||||
|
||||
Sent = AvailableFolders.Find(a => a.SpecialFolderType == Core.Domain.Enums.SpecialFolderType.Sent);
|
||||
Draft = AvailableFolders.Find(a => a.SpecialFolderType == Core.Domain.Enums.SpecialFolderType.Draft);
|
||||
Archive = AvailableFolders.Find(a => a.SpecialFolderType == Core.Domain.Enums.SpecialFolderType.Archive);
|
||||
Junk = AvailableFolders.Find(a => a.SpecialFolderType == Core.Domain.Enums.SpecialFolderType.Junk);
|
||||
Trash = AvailableFolders.Find(a => a.SpecialFolderType == Core.Domain.Enums.SpecialFolderType.Deleted);
|
||||
}
|
||||
|
||||
private void DialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
|
||||
{
|
||||
args.Cancel = !canDismissDialog;
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
=> canDismissDialog = true;
|
||||
|
||||
private void SaveClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
ValidationErrorTextBlock.Text = string.Empty;
|
||||
|
||||
var allSpecialFolders = new List<MailItemFolder>()
|
||||
{
|
||||
Sent, Draft, Archive, Trash, Junk
|
||||
};
|
||||
|
||||
if (allSpecialFolders.Any(a => a != null && a.SpecialFolderType == SpecialFolderType.Inbox))
|
||||
ValidationErrorTextBlock.Text = Translator.SystemFolderConfigDialogValidation_InboxSelected;
|
||||
|
||||
if (new HashSet<Guid>(allSpecialFolders.Where(a => a != null).Select(x => x.Id)).Count != allSpecialFolders.Where(a => a != null).Count())
|
||||
ValidationErrorTextBlock.Text = Translator.SystemFolderConfigDialogValidation_DuplicateSystemFolders;
|
||||
|
||||
// Check if we can save.
|
||||
if (string.IsNullOrEmpty(ValidationErrorTextBlock.Text))
|
||||
{
|
||||
var configuration = new SystemFolderConfiguration(Sent, Draft, Archive, Trash, Junk);
|
||||
|
||||
canDismissDialog = true;
|
||||
Configuration = configuration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Wino.Mail/Dialogs/TextInputDialog.xaml
Normal file
29
Wino.Mail/Dialogs/TextInputDialog.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.TextInputDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
DefaultButton="Primary"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
PrimaryButtonText="{x:Bind domain:Translator.Buttons_Create}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
PrimaryButtonClick="UpdateOrCreateClicked"
|
||||
SecondaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
|
||||
SecondaryButtonClick="CancelClicked"
|
||||
VerticalContentAlignment="Stretch"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">400</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxWidth">400</x:Double>
|
||||
<x:Double x:Key="ContentDialogMinHeight">200</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock x:Name="DialogDescription" TextWrapping="Wrap" />
|
||||
<TextBox x:Name="FolderTextBox" Text="{x:Bind CurrentInput, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</ContentDialog>
|
||||
40
Wino.Mail/Dialogs/TextInputDialog.xaml.cs
Normal file
40
Wino.Mail/Dialogs/TextInputDialog.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class TextInputDialog : ContentDialog
|
||||
{
|
||||
public bool? HasInput { get; set; }
|
||||
|
||||
public string CurrentInput
|
||||
{
|
||||
get { return (string)GetValue(CurrentInputProperty); }
|
||||
set { SetValue(CurrentInputProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty CurrentInputProperty = DependencyProperty.Register(nameof(CurrentInput), typeof(string), typeof(TextInputDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
public TextInputDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetDescription(string description)
|
||||
{
|
||||
DialogDescription.Text = description;
|
||||
}
|
||||
|
||||
private void CancelClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void UpdateOrCreateClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
HasInput = true;
|
||||
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Wino.Mail/Dialogs/WinoMessageDialog.xaml
Normal file
25
Wino.Mail/Dialogs/WinoMessageDialog.xaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<ContentDialog
|
||||
x:Class="Wino.Dialogs.WinoMessageDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="{x:Bind DialogTitle, Mode=OneWay}"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
Style="{StaticResource WinoDialogStyle}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
CloseButtonText="{x:Bind domain:Translator.Buttons_Close}"
|
||||
DefaultButton="Close"
|
||||
Closed="DialogClosed"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="ContentDialogMinWidth">250</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
||||
<x:Double x:Key="ContentDialogMinHeight">200</x:Double>
|
||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<TextBlock Text="{x:Bind Message, Mode=OneWay}" TextWrapping="Wrap" />
|
||||
</ContentDialog>
|
||||
60
Wino.Mail/Dialogs/WinoMessageDialog.xaml.cs
Normal file
60
Wino.Mail/Dialogs/WinoMessageDialog.xaml.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Dialogs
|
||||
{
|
||||
public sealed partial class WinoMessageDialog : ContentDialog
|
||||
{
|
||||
private TaskCompletionSource<bool> _completionSource;
|
||||
|
||||
#region Dependency Properties
|
||||
|
||||
public string DialogTitle
|
||||
{
|
||||
get { return (string)GetValue(DialogTitleProperty); }
|
||||
set { SetValue(DialogTitleProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DialogTitleProperty = DependencyProperty.Register(nameof(DialogTitle), typeof(string), typeof(ConfirmationDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return (string)GetValue(MessageProperty); }
|
||||
set { SetValue(MessageProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(nameof(Message), typeof(string), typeof(ConfirmationDialog), new PropertyMetadata(string.Empty));
|
||||
|
||||
#endregion
|
||||
|
||||
public WinoMessageDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public async Task<bool> ShowDialogAsync(string title, string message)
|
||||
{
|
||||
_completionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
DialogTitle = title;
|
||||
Message = message;
|
||||
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
ShowAsync();
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
|
||||
return await _completionSource.Task;
|
||||
}
|
||||
|
||||
private void ApproveClicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void DialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
|
||||
{
|
||||
_completionSource.TrySetResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user