<abstract:CalendarPreferenceSettingsPageAbstract
    x:Class="Wino.Mail.WinUI.Views.Calendar.CalendarPreferenceSettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:abstract="using:Wino.Mail.WinUI.Views.Abstract"
    xmlns:calendarViewModels="using:Wino.Calendar.ViewModels"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:data="using:Wino.Calendar.ViewModels.Data"
    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">

    <ScrollViewer>
        <StackPanel Spacing="{StaticResource SettingsCardSpacing}">
            <controls:SettingsCard Description="{x:Bind domain:Translator.CalendarSettings_NewEventBehavior_Description}" Header="{x:Bind domain:Translator.CalendarSettings_NewEventBehavior_Header}">
                <controls:SettingsCard.HeaderIcon>
                    <FontIcon Glyph="&#xE163;" />
                </controls:SettingsCard.HeaderIcon>
                <controls:SettingsCard.Content>
                    <StackPanel Spacing="12">
                        <ComboBox ItemsSource="{x:Bind ViewModel.NewEventBehaviorOptions, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedNewEventBehaviorOption, Mode=TwoWay}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate x:DataType="calendarViewModels:CalendarNewEventBehaviorOption">
                                    <TextBlock Text="{x:Bind DisplayText}" />
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <ComboBox
                            ItemsSource="{x:Bind ViewModel.AvailableNewEventCalendars, Mode=OneWay}"
                            SelectedItem="{x:Bind ViewModel.SelectedNewEventCalendar, Mode=TwoWay}"
                            Visibility="{x:Bind ViewModel.ShouldShowSpecificNewEventCalendar, Mode=OneWay}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate x:DataType="data:AccountCalendarViewModel">
                                    <StackPanel Orientation="Vertical" Spacing="2">
                                        <TextBlock Text="{x:Bind Name}" />
                                        <TextBlock
                                            FontSize="12"
                                            Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                            Text="{x:Bind Account.Address}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </StackPanel>
                </controls:SettingsCard.Content>
            </controls:SettingsCard>
        </StackPanel>
    </ScrollViewer>
</abstract:CalendarPreferenceSettingsPageAbstract>
