Files
Wino-Mail/Wino.Calendar/Views/Account/AccountManagementPage.xaml

180 lines
27 KiB
Plaintext
Raw Normal View History

<abstract:AccountManagementPageAbstract
x:Class="Wino.Calendar.Views.Account.AccountManagementPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:abstract="using:Wino.Calendar.Views.Abstract"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="using:Wino.Core.Domain"
xmlns:local="using:Wino.Calendar.Views.Account"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:winuiControls="using:CommunityToolkit.WinUI.Controls"
2025-01-06 21:56:33 +01:00
x:Name="root"
mc:Ignorable="d">
<ScrollViewer Margin="-12,0">
<Grid
MaxWidth="900"
Padding="20"
HorizontalAlignment="Stretch"
RowSpacing="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Add account button. -->
<Button
Grid.Row="0"
Width="200"
Height="200"
Margin="0,12"
Command="{x:Bind ViewModel.AddNewAccountCommand}">
<Button.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Spacing="12">
<Viewbox Width="46">
<PathIcon Data="F1 M 17.5 9.375 C 17.5 9.544271 17.43815 9.690756 17.314453 9.814453 C 17.190754 9.938151 17.04427 10 16.875 10 L 10 10 L 10 16.875 C 10 17.044271 9.93815 17.190756 9.814453 17.314453 C 9.690755 17.43815 9.544271 17.5 9.375 17.5 C 9.205729 17.5 9.059244 17.43815 8.935547 17.314453 C 8.811849 17.190756 8.75 17.044271 8.75 16.875 L 8.75 10 L 1.875 10 C 1.705729 10 1.559245 9.938151 1.435547 9.814453 C 1.311849 9.690756 1.25 9.544271 1.25 9.375 C 1.25 9.205729 1.311849 9.059245 1.435547 8.935547 C 1.559245 8.81185 1.705729 8.75 1.875 8.75 L 8.75 8.75 L 8.75 1.875 C 8.75 1.70573 8.811849 1.559246 8.935547 1.435547 C 9.059244 1.31185 9.205729 1.25 9.375 1.25 C 9.544271 1.25 9.690755 1.31185 9.814453 1.435547 C 9.93815 1.559246 10 1.70573 10 1.875 L 10 8.75 L 16.875 8.75 C 17.04427 8.75 17.190754 8.81185 17.314453 8.935547 C 17.43815 9.059245 17.5 9.205729 17.5 9.375 Z " />
</Viewbox>
<TextBlock FontWeight="SemiBold" Text="{x:Bind domain:Translator.Buttons_AddAccount}" />
</StackPanel>
</Grid>
</Button.Content>
</Button>
<!-- Account Limits -->
<Grid
x:Name="PurchasePanel"
Grid.Column="1"
x:Load="{x:Bind ViewModel.IsPurchasePanelVisible, Mode=OneWay}">
<winuiControls:SettingsCard
Margin="0,12"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ContentAlignment="Vertical">
<Grid MinHeight="160" RowSpacing="6">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Viewbox
Width="32"
Height="32"
HorizontalAlignment="Left">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 4.921875 18.75 C 4.433594 18.75 3.966471 18.650717 3.520508 18.452148 C 3.074544 18.25358 2.683919 17.986654 2.348633 17.651367 C 2.013346 17.31608 1.746419 16.925455 1.547852 16.479492 C 1.349284 16.033529 1.25 15.566406 1.25 15.078125 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 15.078125 1.25 C 15.566406 1.25 16.033527 1.349285 16.479492 1.547852 C 16.925455 1.74642 17.31608 2.013348 17.651367 2.348633 C 17.986652 2.68392 18.25358 3.074545 18.452148 3.520508 C 18.650715 3.966473 18.75 4.433594 18.75 4.921875 L 18.75 15.078125 C 18.75 15.566406 18.650715 16.033529 18.452148 16.479492 C 18.25358 16.925455 17.986652 17.31608 17.651367 17.651367 C 17.31608 17.986654 16.925455 18.25358 16.479492 18.452148 C 16.033527 18.650717 15.566406 18.75 15.078125 18.75 Z M 15.048828 17.5 C 15.374349 17.5 15.685221 17.433268 15.981445 17.299805 C 16.277668 17.166342 16.538086 16.987305 16.762695 16.762695 C 16.987305 16.538086 17.16634 16.27767 17.299805 15.981445 C 17.433268 15.685222 17.5 15.37435 17.5 15.048828 L 17.5 4.951172 C 17.5 4.625651 17.433268 4.314779 17.299805 4.018555 C 17.16634 3.722332 16.987305 3.461914 16.762695 3.237305 C 16.538086 3.012695 16.277668 2.83366 15.981445 2.700195 C 15.685221 2.566732 15.374349 2.5 15.048828 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 15.048828 C 2.5 15.37435 2.566732 15.685222 2.700195 15.981445 C 2.833659 16.27767 3.012695 16.538086 3.237305 16.762695 C 3.461914 16.987305 3.722331 17.166342 4.018555 17.299805 C 4.314778 17.433268 4.625651 17.5 4.951172 17.5 Z M 7.5 7.451172 C 7.5 7.112631 7.568359 6.795248 7.705078 6.499023 C 7.841796 6.202801 8.024088 5.944012 8.251953 5.722656 C 8.479817 5.501303 8.745117 5.325521 9.047852 5.195312 C 9.350586 5.065105 9.667969 5.000001 10 5 C 10.338541 5.000001 10.660807 5.066732 10.966797 5.200195 C 11.272786 5.333659 11.538086 5.512695 11.762695 5.737305 C 11.987304 5.961914 12.16634 6.227214 12.299805 6.533203 C 12.433268 6.839193 12.5 7.161459 12.5 7.5 C 12.5 7.845053 12.433268 8.168945 12.299805 8.47168 C 12.16634 8.774414 11.987304 9.038086 11.762695 9.262695 C 11.538086 9.487305 11.272786 9.666342 10.966797 9.799805 C 10.660807 9.933269 10.338541 10 10 10 C 9.648438 10 9.319661 9.933269 9.013672 9.799805 C 8.707682 9.666342 8.442383 9.48405 8.217773 9.25293 C 7.993164 9.021811 7.817382 8.751628 7.69043 8.442383 C 7.563476 8.133139 7.5 7.802734 7.5 7.451172 Z M 11.25 7.5 C 11.25 7.330729 11.217447 7.169597 11.152344 7.016602 C 11.087239 6.863607 10.997721 6.730145 10.883789 6.616211 C 10.769856 6.502279 10.636393 6.412761 10.483398 6.347656 C 10.330403 6.282553 10.169271 6.25 10 6.25 C 9.824219 6.25 9.661458 6.282553 9.511719 6.347656 C 9.361979 6.412761 9.230143 6.502279 9.116211 6.616211 C 9.002278 6.730145 8.91276 6.86198 8.847656 7.011719 C 8.782552 7.161459 8.75 7.324219 8.75 7.5 C 8.75 7.675781 8.782552 7.84017 8.847656 7.993164 C 8.91276 8.146159 9.00065 8.277995 9.111328 8.388672 C 9.222005 8.49935 9.353841 8.58724 9.506836 8.652344 C 9.65983 8.717448 9.824219 8.75 10 8.75 C 10.175781 8.75 10.338541 8.717448 10.488281 8.652344 C 10.638021 8.58724 10.769856 8.497722 10.883789 8.383789 C 10.997721 8.269857 11.087239 8.138021 11.152344 7.988281 C 11.217447 7.838542 11.25 7.675781 11.25 7.5 Z M 5.488281 12.880859 C 5.488281 12.639975 5.530599 12.41862 5.615234 12.216797 C 5.69987 12.014975 5.81543 11.842448 5.961914 11.699219 C 6.108398 11.55599 6.282552 11.445312 6.484375 11.367188 C 6.686198 11.289062 6.907552 11.25 7.148438 11.25 L 12.851562 11.25 C 13.092447 11.25 13.313801 11.289062 13.515625 11.367188 C 13.717447 11.445312 13.891602 11.55599 14.038086 11.699219 C 14.18457 11.842448 14.30013 12.014975 14.384766 12.216
</Viewbox>
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
FontWeight="SemiBold"
Style="{StaticResource BodyTextBlockStyle}"
Text="{x:Bind domain:Translator.WinoUpgradeDescription}"
TextTrimming="CharacterEllipsis" />
</Grid>
<StackPanel
Grid.Row="2"
VerticalAlignment="Center"
Spacing="12">
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{x:Bind ViewModel.UsedAccountsString, Mode=OneWay}" />
<muxc:ProgressBar
Maximum="{x:Bind ViewModel.FREE_ACCOUNT_COUNT}"
ShowError="{x:Bind ViewModel.IsAccountCreationBlocked, Mode=OneWay}"
ShowPaused="{x:Bind ViewModel.IsAccountCreationAlmostOnLimit, Mode=OneWay}"
Value="{x:Bind ViewModel.Accounts.Count, Mode=OneWay}" />
</StackPanel>
<Button
Grid.Row="3"
MinHeight="45"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Command="{x:Bind ViewModel.PurchaseUnlimitedAccountCommand}"
Style="{StaticResource AccentButtonStyle}">
<StackPanel Orientation="Horizontal" Spacing="6">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 1.25 7.480469 C 1.25 7.207031 1.329753 6.956381 1.489258 6.728516 C 1.648763 6.500651 1.858724 6.344401 2.119141 6.259766 L 3.857422 5.703125 C 4.065755 5.631511 4.264323 5.533854 4.453125 5.410156 C 4.641927 5.286459 4.811198 5.14974 4.960938 5 C 5.286458 4.674479 5.517578 4.303386 5.654297 3.886719 L 6.220703 2.138672 C 6.305338 1.878256 6.463216 1.665039 6.694336 1.499023 C 6.925456 1.333008 7.177734 1.25 7.451172 1.25 C 7.724609 1.25 7.976888 1.328125 8.208008 1.484375 C 8.439127 1.640625 8.60026 1.852215 8.691406 2.119141 L 9.257812 3.847656 C 9.394531 4.277344 9.628906 4.658203 9.960938 4.990234 C 10.279947 5.315756 10.660807 5.550131 11.103516 5.693359 L 12.822266 6.259766 C 13.102213 6.350912 13.326822 6.507162 13.496094 6.728516 C 13.665364 6.94987 13.75 7.210287 13.75 7.509766 C 13.75 7.776693 13.668619 8.025717 13.505859 8.256836 C 13.343099 8.487956 13.134766 8.645834 12.880859 8.730469 L 11.142578 9.296875 C 10.712891 9.433594 10.332031 9.667969 10 10 C 9.791666 10.208334 9.624023 10.445964 9.49707 10.712891 C 9.370117 10.979818 9.262695 11.253256 9.174805 11.533203 C 9.086914 11.813151 9.003906 12.084961 8.925781 12.348633 C 8.847656 12.612305 8.75 12.848308 8.632812 13.056641 C 8.515625 13.264975 8.369141 13.432617 8.193359 13.55957 C 8.017578 13.686523 7.786458 13.75 7.5 13.75 C 7.226562 13.75 6.974283 13.670248 6.743164 13.510742 C 6.512044 13.351237 6.354167 13.141276 6.269531 12.880859 L 5.703125 11.142578 C 5.651042 10.979818 5.587565 10.825195 5.512695 10.678711 C 5.437825 10.532227 5.348307 10.393881 5.244141 10.263672 C 5.022786 9.983725 4.770508 9.76237 4.487305 9.599609 C 4.204102 9.43685 3.916016 9.303386 3.623047 9.199219 C 3.330078 9.095053 3.040365 9.005534 2.753906 8.930664 C 2.467448 8.855795 2.213542 8.761394 1.992188 8.647461 C 1.770833 8.533529 1.591797 8.388672 1.455078 8.212891 C 1.318359 8.037109 1.25 7.792969 1.25 7.480469 Z M 12.470703 7.548828 C 11.975911 7.360026 11.502278 7.185873 11.049805 7.026367 C 10.59733 6.866863 10.179036 6.671551 9.794922 6.44043 C 9.410807 6.209311 9.070638 5.922852 8.774414 5.581055 C 8.478189 5.239258 8.242188 4.791667 8.066406 4.238281 L 7.509766 2.519531 L 6.855469 4.238281 C 6.738281 4.550782 6.601562 4.840496 6.445312 5.107422 C 6.289062 5.37435 6.09375 5.628256 5.859375 5.869141 C 5.638021 6.090496 5.388997 6.290691 5.112305 6.469727 C 4.835612 6.648764 4.547526 6.787109 4.248047 6.884766 L 2.519531 7.441406 C 3.007812 7.630209 3.476562 7.804363 3.925781 7.963867 C 4.375 8.123373 4.788411 8.318686 5.166016 8.549805 C 5.54362 8.780925 5.880534 9.069011 6.176758 9.414062 C 6.472981 9.759115 6.708984 10.205078 6.884766 10.751953 L 7.441406 12.470703 L 8.095703 10.751953 C 8.336588 10.120443 8.673502 9.573568 9.106445 9.111328 C 9.539388 8.649089 10.084635 8.313803 10.742188 8.105469 Z M 11.25 14.960938 C 11.25 14.759115 11.315104 14.573568 11.445312 14.404297 C 11.575521 14.235026 11.735025 14.117839 11.923828 14.052734 L 12.890625 13.740234 C 13.111979 13.66862 13.284505 13.557943 13.408203 13.408203 C 13.5319 13.258464 13.631184 13.09082 13.706055 12.905273 C 13.780924 12.719727 13.8444 12.529297 13.896484 12.333984 C 13.948566 12.138672 14.015299 11.961264 14.09668 11.801758 C 14.17806 11.642253 14.285481 11.510417 14.418945 11.40625 C 14.552408 11.302084 14.739582 11.25 14.980469 11.25 C 15.188801 11.25 15.382486 11.31185 15.561523 11.435547 C 15.74056 11.559245 15.86263 11.722006 15.927734 11.923828 C 15.966797 12.054037 16.00423 12.185873 16.040039 12.319336 C 16.075846 12.4528 16.116535 12.583008 16.162109 12.709961 C 16.207682 12.836914 16.26302 12.960612 16.328125 13.081055 C 16.393229 13.201498 16.474609 13.310547 16.572266 13.408203 C 16.676432 13.518881 16.803385 13.605144 16.953125 13.666992 C 17.102863 13.728842 17.259113 13.785808 17.421875 13.837891 C 17.584635 13.889975 17.745768 13.942058 17.905273 13.994141 C 18.064777 14.046225 18.206379 14.112956 18.330078 14.194336 C 18.453775 14.275717 18.554688 14.379883 18.632812 14.506836 C 18.710938 14.633789 18.75 14.794922 18.75 14.99023
<TextBlock
Text="{x:Bind domain:Translator.WinoUpgradeMessage}"
TextAlignment="Center"
TextWrapping="WrapWholeWords" />
</StackPanel>
</Button>
</Grid>
</winuiControls:SettingsCard>
</Grid>
</Grid>
<!-- Current Accounts -->
<ListView
x:Name="AccountsListView"
Grid.Row="1"
x:Load="{x:Bind ViewModel.HasAccountsDefined, Mode=OneWay}"
ItemContainerStyle="{StaticResource StretchedItemContainerStyle}"
ItemTemplate="{StaticResource RootAccountTemplate}"
ItemsSource="{x:Bind ViewModel.Accounts, Mode=OneWay}"
SelectionMode="None">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
<!-- No Accounts Panel -->
<!-- TODO: Shared -->
<Grid
x:Name="NoAccountsPanel"
Grid.Row="1"
x:Load="{x:Bind ViewModel.HasAccountsDefined, Mode=OneWay, Converter={StaticResource ReverseBooleanConverter}}">
<StackPanel
Margin="0,150,0,0"
VerticalAlignment="Top"
Spacing="12">
<Viewbox
Width="90"
Height="90"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 18.066406 6.71875 C 18.359375 6.881512 18.626301 7.081707 18.867188 7.319336 C 19.108072 7.556967 19.311523 7.817383 19.477539 8.100586 C 19.643555 8.383789 19.772135 8.686523 19.863281 9.008789 C 19.954426 9.331055 20 9.661459 20 10 L 18.75 10 C 18.75 9.661459 18.683268 9.339193 18.549805 9.033203 C 18.41634 8.727214 18.237305 8.461914 18.012695 8.237305 C 17.788086 8.012696 17.522785 7.83366 17.216797 7.700195 C 16.910807 7.566732 16.588541 7.5 16.25 7.5 C 15.904947 7.5 15.581054 7.566732 15.27832 7.700195 C 14.975585 7.83366 14.711913 8.012696 14.487305 8.237305 C 14.262694 8.461914 14.083658 8.727214 13.950195 9.033203 C 13.816731 9.339193 13.75 9.661459 13.75 10 C 13.75 10.592448 13.614908 11.1556 13.344727 11.689453 C 13.074544 12.223308 12.701822 12.666016 12.226562 13.017578 C 12.649738 13.232422 13.032226 13.497722 13.374023 13.813477 C 13.715819 14.129232 14.00716 14.480795 14.248047 14.868164 C 14.488932 15.255534 14.674479 15.672201 14.804688 16.118164 C 14.934895 16.564127 14.999999 17.02474 15 17.5 L 13.75 17.5 C 13.75 16.985678 13.650716 16.50065 13.452148 16.044922 C 13.25358 15.589193 12.985025 15.192058 12.646484 14.853516 C 12.307942 14.514975 11.910807 14.24642 11.455078 14.047852 C 10.999349 13.849284 10.514322 13.75 10 13.75 C 9.485677 13.75 9.00065 13.849284 8.544922 14.047852 C 8.089192 14.24642 7.692057 14.514975 7.353516 14.853516 C 7.014974 15.192058 6.746419 15.589193 6.547852 16.044922 C 6.349284 16.50065 6.25 16.985678 6.25 17.5 L 5 17.5 C 5 17.02474 5.065104 16.564127 5.195312 16.118164 C 5.325521 15.672201 5.511067 15.255534 5.751953 14.868164 C 5.992838 14.480795 6.28418 14.129232 6.625977 13.813477 C 6.967773 13.497722 7.35026 13.232422 7.773438 13.017578 C 7.298177 12.666016 6.925455 12.223308 6.655273 11.689453 C 6.385091 11.1556 6.25 10.592448 6.25 10 C 6.25 9.661459 6.183268 9.339193 6.049805 9.033203 C 5.916341 8.727214 5.737305 8.461914 5.512695 8.237305 C 5.288086 8.012696 5.022786 7.83366 4.716797 7.700195 C 4.410807 7.566732 4.088542 7.5 3.75 7.5 C 3.404948 7.5 3.081055 7.566732 2.77832 7.700195 C 2.475586 7.83366 2.211914 8.012696 1.987305 8.237305 C 1.762695 8.461914 1.583659 8.727214 1.450195 9.033203 C 1.316732 9.339193 1.25 9.661459 1.25 10 L 0 10 C 0 9.661459 0.045573 9.331055 0.136719 9.008789 C 0.227865 8.686523 0.356445 8.383789 0.522461 8.100586 C 0.688477 7.817383 0.891927 7.556967 1.132812 7.319336 C 1.373698 7.081707 1.640625 6.881512 1.933594 6.71875 C 1.71875 6.490887 1.551107 6.227215 1.430664 5.927734 C 1.310221 5.628256 1.25 5.319011 1.25 5 C 1.25 4.661459 1.316732 4.339193 1.450195 4.033203 C 1.583659 3.727215 1.762695 3.461914 1.987305 3.237305 C 2.211914 3.012695 2.475586 2.83366 2.77832 2.700195 C 3.081055 2.566732 3.404948 2.5 3.75 2.5 C 4.088542 2.5 4.410807 2.566732 4.716797 2.700195 C 5.022786 2.83366 5.288086 3.012695 5.512695 3.237305 C 5.737305 3.461914 5.916341 3.727215 6.049805 4.033203 C 6.183268 4.339193 6.25 4.661459 6.25 5 C 6.25 5.319011 6.189778 5.628256 6.069336 5.927734 C 5.948893 6.227215 5.78125 6.490887 5.566406 6.71875 C 6.10026 7.011719 6.536458 7.415365 6.875 7.929688 C 7.226562 7.408854 7.677409 6.998698 8.227539 6.699219 C 8.777669 6.39974 9.368489 6.25 10 6.25 C 10.63151 6.25 11.22233 6.39974 11.772461 6.699219 C 12.32259 6.998698 12.773437 7.408854 13.125 7.929688 C 13.463541 7.415365 13.899739 7.011719 14.433594 6.71875 C 14.21875 6.490887 14.051106 6.227215 13.930664 5.927734 C 13.810221 5.628256 13.75 5.319011 13.75 5 C 13.75 4.661459 13.816731 4.339193 13.950195 4.033203 C 14.083658 3.727215 14.262694 3.461914 14.487305 3.237305 C 14.711913 3.012695 14.975585 2.83366 15.27832 2.700195 C 15.581054 2.566732 15.904947 2.5 16.25 2.5 C 16.588541 2.5 16.910807 2.566732 17.216797 2.700195 C 17.522785 2.83366 17.788086 3.012695 18.012695 3.237305 C 18.237305 3.461914 18.41634 3.727215 18.549805 4.033203 C 18.683268 4.339193 18.75 4.661459 18.75 5 C 18.75 5.319011 18.689777 5.628256 18.569336 5.927734 C 18.448893 6.227215 18.28125 6.490887 18.066406 6.71875 Z M 2.5 5 C 2.5 5.175782 2.532552 5.338
</Viewbox>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource SubheaderTextBlockStyle}"
Text="{x:Bind domain:Translator.SettingsNoAccountSetupMessage}" />
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</abstract:AccountManagementPageAbstract>