<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:coreControls="using:Wino.Core.UWP.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:domain="using:Wino.Core.Domain"
    xmlns:folders="using:Wino.Core.Domain.Models.Folders"
    xmlns:helpers="using:Wino.Helpers"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    Title="{x:Bind domain:Translator.MoveMailDialog_Title}"
    DefaultButton="Primary"
    PrimaryButtonClick="CancelClicked"
    PrimaryButtonText="{x:Bind domain:Translator.Buttons_Cancel}"
    Style="{StaticResource WinoDialogStyle}"
    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 IsExpanded="True" ItemsSource="{x:Bind ChildFolders}">
                <StackPanel
                    Height="32"
                    Orientation="Horizontal"
                    Spacing="12">
                    <coreControls: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"
            Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}"
            Visibility="Collapsed" />

        <muxc:TreeView
            x:Name="FolderTreeView"
            Grid.Row="1"
            CanDragItems="False"
            CanReorderItems="False"
            ItemTemplate="{StaticResource FolderStructureMenuFlyoutItemTemplate}"
            ItemsSource="{x:Bind FolderList, Mode=OneWay}"
            SelectedItem="{x:Bind SelectedFolder, Mode=TwoWay}"
            SelectionMode="Single" />
    </Grid>
</ContentDialog>
