Files
Wino-Mail/Wino.Calendar/Views/Settings/AccountDetailsPage.xaml
Burak Kaan Köse 70e69e9dac Wino Calendar slnx
2025-03-15 15:23:26 +01:00

126 lines
19 KiB
XML

<abstract:AccountDetailsPageAbstract
x:Class="Wino.Calendar.Views.Settings.AccountDetailsPage"
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:calendar="using:Wino.Core.Domain.Entities.Calendar"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:data="using:Wino.Calendar.ViewModels.Data"
xmlns:domain="using:Wino.Core.Domain"
xmlns:helpers="using:Wino.Helpers"
xmlns:local="using:Wino.Calendar.Views.Settings"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Spacing="4">
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsAccountName_Description}" Header="{x:Bind domain:Translator.SettingsAccountName_Title}">
<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>
<Button Command="{x:Bind ViewModel.EditAccountDetailsCommand}" Content="{x:Bind domain:Translator.FolderOperation_Rename}" />
</controls:SettingsCard>
<!-- TODO -->
<controls:SettingsExpander Description="Change expansion state and display colors for each calendar." Header="Calendar Display Configuration">
<controls:SettingsExpander.HeaderIcon>
<PathIcon Data="F1 M 6.328125 11.835938 C 6.035156 11.835938 5.768229 11.894531 5.527344 12.011719 C 5.286458 12.128906 5.050456 12.259115 4.819336 12.402344 C 4.588216 12.545573 4.348958 12.675781 4.101562 12.792969 C 3.854167 12.910156 3.580729 12.96875 3.28125 12.96875 C 2.877604 12.96875 2.49349 12.871094 2.128906 12.675781 C 1.764323 12.480469 1.435547 12.255859 1.142578 12.001953 C 0.745443 11.656901 0.455729 11.261394 0.273438 10.81543 C 0.091146 10.369467 0 9.886068 0 9.365234 C 0 8.844401 0.071615 8.325195 0.214844 7.807617 C 0.358073 7.290039 0.533854 6.796875 0.742188 6.328125 C 0.970052 5.820312 1.233724 5.328776 1.533203 4.853516 C 1.832682 4.378256 2.158203 3.925781 2.509766 3.496094 C 2.828776 3.105469 3.167318 2.736004 3.525391 2.387695 C 3.883463 2.039389 4.277344 1.728516 4.707031 1.455078 C 5.442708 0.986328 6.225586 0.628256 7.055664 0.380859 C 7.885742 0.133465 8.736979 0.009766 9.609375 0.009766 C 10.436197 0.009766 11.25 0.117188 12.050781 0.332031 C 12.851562 0.546875 13.616536 0.849609 14.345703 1.240234 C 15.23763 1.728516 16.033527 2.298178 16.733398 2.949219 C 17.433268 3.600262 18.025715 4.322917 18.510742 5.117188 C 18.995768 5.911459 19.365234 6.769206 19.619141 7.69043 C 19.873047 8.611654 20 9.583334 20 10.605469 C 20 11.230469 19.952799 11.850586 19.858398 12.46582 C 19.763996 13.081055 19.62565 13.688151 19.443359 14.287109 C 19.300129 14.74935 19.119465 15.213217 18.901367 15.678711 C 18.683268 16.144205 18.427734 16.59017 18.134766 17.016602 C 17.841797 17.443033 17.516275 17.843424 17.158203 18.217773 C 16.800129 18.592123 16.411133 18.916016 15.991211 19.189453 C 15.571289 19.462891 15.12207 19.677734 14.643555 19.833984 C 14.165039 19.990234 13.662109 20.068359 13.134766 20.068359 C 12.841797 20.068359 12.553711 20.042318 12.270508 19.990234 C 11.987305 19.93815 11.708984 19.863281 11.435547 19.765625 C 10.86263 19.563803 10.371094 19.31315 9.960938 19.013672 C 9.550781 18.714193 9.210611 18.365885 8.94043 17.96875 C 8.670247 17.571615 8.465169 17.12565 8.325195 16.630859 C 8.185221 16.136068 8.095703 15.592448 8.056641 15 C 8.030599 14.641928 8.012695 14.283854 8.00293 13.925781 C 7.993164 13.567709 7.945963 13.212891 7.861328 12.861328 C 7.835286 12.763672 7.805989 12.659506 7.773438 12.548828 C 7.740885 12.438151 7.688802 12.347006 7.617188 12.275391 C 7.545573 12.197266 7.457682 12.128906 7.353516 12.070312 C 7.249349 12.011719 7.138672 11.966146 7.021484 11.933594 C 6.904297 11.901042 6.785481 11.876628 6.665039 11.860352 C 6.544596 11.844076 6.432292 11.835938 6.328125 11.835938 Z M 13.134766 18.818359 C 13.623047 18.818359 14.088541 18.725586 14.53125 18.540039 C 14.973958 18.354492 15.384114 18.108725 15.761719 17.802734 C 16.276041 17.386068 16.722004 16.894531 17.099609 16.328125 C 17.477213 15.761719 17.789713 15.157878 18.037109 14.516602 C 18.284504 13.875326 18.466797 13.214519 18.583984 12.53418 C 18.701172 11.853842 18.759766 11.191406 18.759766 10.546875 C 18.759766 9.641928 18.647461 8.785808 18.422852 7.978516 C 18.198242 7.171225 17.871094 6.420898 17.441406 5.727539 C 17.011719 5.03418 16.487629 4.404297 15.869141 3.837891 C 15.25065 3.271484 14.547525 2.773438 13.759766 2.34375 C 13.128255 1.998699 12.460938 1.728516 11.757812 1.533203 C 11.054688 1.337891 10.338541 1.240234 9.609375 1.240234 C 8.710938 1.240234 7.869466 1.383465 7.084961 1.669922 C 6.300456 1.956381 5.582682 2.351889 4.931641 2.856445 C 4.280599 3.361004 3.697917 3.953451 3.183594 4.633789 C 2.669271 5.314128 2.236328 6.048178 1.884766 6.835938 C 1.702474 7.233074 1.551107 7.64323 1.430664 8.066406 C 1.310221 8.489584 1.25 8.922526 1.25 9.365234 C 1.25 9.703776 1.302083 10.011394 1.40625 10.288086 C 1.510417 10.564779 1.689453 10.817058 1.943359 11.044922 C 2.014974 11.110026 2.104492 11.181641 2.211914 11.259766 C 2.319336 11.337891 2.431641 11.411133 2.548828 11.479492 C 2.666016 11.547852 2.783203 11.606445 2.900391 11.655273 C 3.017578 11.704102 3.125 11.728516 3.222656 11.728516 C 3.404948 11.728516 3.60026 11.668295 3.808594 11.547852 C 4.016927 11.427409 4.246419 11.297201 4.49707 11.157227 C 4.747721 11.017253 5.022786 10.887045 5.322266 10.766602 C 5.621745 10.646159 5.957031 10.585938 6.328125 10.585938 C 6.529948 10.585938 6.731771 10.603842 6.933594 10.639648 C 7.135416 10.675456 7.330729 10.722656 7.519531 10.78125 C 7.942708 10.917969 8.268229 11.113281 8.496094 11.367188 C 8.723958 11.621094 8.891602 11.912436 8.999023 12.241211 C 9.106445 12.569987 9.173177 12.928061 9.199219 13.31543 C 9.22526 13.7028 9.249674 14.098308 9.272461 14.501953 C 9.295247 14.9056 9.337564 15.309245 9.399414 15.712891 C 9.461263 16.116537 9.580078 16.499023 9.755859 16.860352 C 9.931641 17.22168 10.185547 17.552084 10.517578 17.851562 C 10.849609 18.151041 11.295572 18.398438 11.855469 18.59375 C 12.272135 18.74349 12.698566 18.818359 13.134766 18.818359 Z M 8.75 4.6875 C 8.75 4.427084 8.841146 4.20573 9.023438 4.023438 C 9.205729 3.841146 9.427083 3.75 9.6875 3.75 C 9.947916 3.75 10.169271 3.841146 10.351562 4.023438 C 10.533854 4.20573 10.625 4.427084 10.625 4.6875 C 10.625 4.947917 10.533854 5.169271 10.351562 5.351562 C 10.169271 5.533854 9.947916 5.625 9.6875 5.625 C 9.427083 5.625 9.205729 5.533854 9.023438 5.351562 C 8.841146 5.169271 8.75 4.947917 8.75 4.6875 Z M 12.5 5.9375 C 12.5 5.677084 12.591146 5.455729 12.773438 5.273438 C 12.955729 5.091146 13.177083 5.000001 13.4375 5 C 13.697916 5.000001 13.91927 5.091146 14.101562 5.273438 C 14.283854 5.455729 14.375 5.677084 14.375 5.9375 C 14.375 6.197917 14.283854 6.419271 14.101562 6.601562 C 13.91927 6.783855 13.697916 6.875001 13.4375 6.875 C 13.177083 6.875001 12.955729 6.783855 12.773438 6.601562 C 12.591146 6.419271 12.5 6.197917 12.5 5.9375 Z M 14.6875 8.75 C 14.6875 8.489584 14.778646 8.268229 14.960938 8.085938 C 15.143229 7.903646 15.364582 7.812501 15.625 7.8125 C 15.885416 7.812501 16.10677 7.903646 16.289062 8.085938 C 16.471354 8.268229 16.5625 8.489584 16.5625 8.75 C 16.5625 9.010417 16.471354 9.231771 16.289062 9.414062 C 16.10677 9.596354 15.885416 9.6875 15.625 9.6875 C 15.364582 9.6875 15.143229 9.596354 14.960938 9.414062 C 14.778646 9.231771 14.6875 9.010417 14.6875 8.75 Z M 14.6875 12.5 C 14.6875 12.239584 14.778646 12.018229 14.960938 11.835938 C 15.143229 11.653646 15.364582 11.5625 15.625 11.5625 C 15.885416 11.5625 16.10677 11.653646 16.289062 11.835938 C 16.471354 12.018229 16.5625 12.239584 16.5625 12.5 C 16.5625 12.760417 16.471354 12.981771 16.289062 13.164062 C 16.10677 13.346354 15.885416 13.4375 15.625 13.4375 C 15.364582 13.4375 15.143229 13.346354 14.960938 13.164062 C 14.778646 12.981771 14.6875 12.760417 14.6875 12.5 Z M 12.1875 15 C 12.187499 14.739584 12.278645 14.518229 12.460938 14.335938 C 12.643229 14.153646 12.864583 14.0625 13.125 14.0625 C 13.385416 14.0625 13.606771 14.153646 13.789062 14.335938 C 13.971354 14.518229 14.062499 14.739584 14.0625 15 C 14.062499 15.260417 13.971354 15.481771 13.789062 15.664062 C 13.606771 15.846354 13.385416 15.9375 13.125 15.9375 C 12.864583 15.9375 12.643229 15.846354 12.460938 15.664062 C 12.278645 15.481771 12.187499 15.260417 12.1875 15 Z " />
</controls:SettingsExpander.HeaderIcon>
<controls:SettingsExpander.Items>
<controls:SettingsCard
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ContentAlignment="Vertical">
<ScrollViewer>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="180" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Headers -->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
FontWeight="SemiBold"
Text="{x:Bind domain:Translator.CalendarDisplayOptions_Expand}"
TextWrapping="Wrap" />
<TextBlock
Grid.Column="1"
HorizontalAlignment="Right"
FontWeight="SemiBold"
Text="{x:Bind domain:Translator.CalendarDisplayOptions_Color}"
TextWrapping="Wrap" />
</Grid>
<ScrollViewer Grid.Row="1" Grid.ColumnSpan="2">
<ItemsControl ItemsSource="{x:Bind ViewModel.AccountCalendarStateService.GroupedAccountCalendars}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="data:GroupedAccountCalendarViewModel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{x:Bind Account.Name}" />
<ItemsControl Grid.Row="1" ItemsSource="{x:Bind AccountCalendars, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="data:AccountCalendarViewModel">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{x:Bind Name, Mode=OneWay}" />
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox HorizontalAlignment="Center" IsChecked="{x:Bind IsExtended, Mode=TwoWay}" />
<Button
Grid.Column="1"
Width="30"
Height="30"
Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(BackgroundColorHex), Mode=OneWay}"
CornerRadius="15">
<Button.Flyout>
<Flyout Placement="Left">
<muxc:ColorPicker VerticalAlignment="Center" Color="{x:Bind helpers:XamlHelpers.GetWindowsColorFromHex(BackgroundColorHex), Mode=TwoWay, BindBack=helpers:XamlHelpers.GetColorFromHex}" />
</Flyout>
</Button.Flyout>
</Button>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</ScrollViewer>
</controls:SettingsCard>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
</StackPanel>
</ScrollViewer>
</abstract:AccountDetailsPageAbstract>