<UserControl x:Class="Hearthstone_Deck_Tracker.SortFilterDecks"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             xmlns:system="clr-namespace:System;assembly=mscorlib"
             xmlns:lex="http://wpflocalizeextension.codeplex.com"
             lex:LocalizeDictionary.DesignCulture="en"
             lex:ResxLocalizationProvider.DefaultAssembly="HearthstoneDeckTracker"
             lex:ResxLocalizationProvider.DefaultDictionary="Strings"
             mc:Ignorable="d"
             d:DesignHeight="600" d:DesignWidth="245">
    <Grid>
        <DockPanel Margin="6,0,6,6">
            <CheckBox Name="CheckBoxSortFavorites" Margin="5,5,0,0" DockPanel.Dock="Top"
                      Checked="CheckBoxSortFavorites_OnChecked" Unchecked="CheckBoxSortFavorites_OnUnchecked">
                <TextBlock Text="{lex:Loc SortFilter_CheckBox_SortFavoriteFirst}" TextWrapping="Wrap"/>
            </CheckBox>
            <GroupBox Name="GroupBoxSortingAllConstructed" Header="{lex:Loc SortFilter_Label_Constructed}" DockPanel.Dock="Top">
                <StackPanel>
                    <CheckBox Name="CheckBoxSortByClass" Content="{lex:Loc SortFilter_CheckBox_SortByClass}"
                        Checked="CheckBoxSortByClass_OnChecked" Unchecked="CheckBoxSortByClass_OnUnchecked" />
                    <ComboBox Name="ComboboxDeckSorting" SelectionChanged="Selector_OnSelectionChanged"
                        Margin="0,5,0,0">
                        <system:String>Most Played</system:String>
                        <system:String>Name</system:String>
                        <system:String>Last Played</system:String>
                        <system:String>Last Played (new first)</system:String>
                        <system:String>Last Edited</system:String>
                        <system:String>Tag</system:String>
                        <system:String>Win Rate</system:String>
                    </ComboBox>
                </StackPanel>
            </GroupBox>
            <GroupBox Name="GroupBoxSortingArena" Header="{lex:Loc SortFilter_Label_Arena}" DockPanel.Dock="Top">
                <StackPanel>
                    <CheckBox Name="CheckBoxSortByClassArena" Content="{lex:Loc SortFilter_CheckBox_SortByClass}"
                            Checked="CheckBoxSortByClassArena_OnChecked" Unchecked="CheckBoxSortByClassArena_OnUnchecked" />
                        <ComboBox Name="ComboboxDeckSortingArena" SelectionChanged="SelectorArena_OnSelectionChanged"
                            Margin="0,5,0,0">
                        <system:String>Most Played</system:String>
                        <system:String>Name</system:String>
                        <system:String>Last Played</system:String>
                        <system:String>Last Played (new first)</system:String>
                        <system:String>Last Edited</system:String>
                        <system:String>Tag</system:String>
                        <system:String>Win Rate</system:String>
                        </ComboBox>
                    </StackPanel>
            </GroupBox>
            <GroupBox Header="{lex:Loc SortFilter_Label_Filter}">
                <DockPanel>
                    <UniformGrid Margin="-2,2,-2,0" DockPanel.Dock="Bottom">
                        <Button Name="BtnUp" Margin="2" Content="{lex:Loc SortFilter_Filter_Button_Up}" Click="BtnUp_OnClick" />
                        <Button Name="BtnTop" Margin="2" Content="{lex:Loc SortFilter_Filter_Button_Top}" Click="BtnTop_OnClick" />
                        <Button Name="BtnDown" Margin="2" Content="{lex:Loc SortFilter_Filter_Button_Down}" Click="BtnDown_OnClick" />
                        <Button Name="BtnBottom" Margin="2" Content="{lex:Loc SortFilter_Filter_Button_Bottom}" Click="BtnBottom_OnClick" />
                    </UniformGrid>
                    <Button x:Name="BtnDeleteTag" DockPanel.Dock="Bottom" Margin="0,4,0,0" Content="{lex:Loc SortFilter_Filter_Button_Delete}"
                            VerticalAlignment="Bottom" Width="auto" Click="BtnDeteleTag_Click" Height="26" />
                    <Grid Margin="0,3,0,0" DockPanel.Dock="Bottom">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBox controls:TextBoxHelper.Watermark="{lex:Loc SortFilter_Filter_Text_NewTag_Watermark}" Name="TextboxNewTag" TextWrapping="NoWrap"
                                 Text=""
                                 Grid.Column="0" Width="auto" Margin="0,0,2,0" />
                        <Button Name="BtnAddTag" Content="{lex:Loc SortFilter_Filter_Button_Add}" Click="BtnAddTag_Click" Height="26" Grid.Column="1"
                                Margin="2,0,0,0" Width="auto" />
                    </Grid>
                    <StackPanel Name="StackPanelFilterOptions" DockPanel.Dock="Bottom">
                        <Separator/>
                        <DockPanel>
                            <controls:ToggleSwitch Name="OperationSwitch" 
                                                   OnLabel="{lex:Loc SortFilter_Filter_SwitchLabel_And}" OffLabel="{lex:Loc SortFilter_Filter_SwitchLabel_Or}" 
                                                   Width="110" HorizontalAlignment="Right" DockPanel.Dock="Right"
                                                   Checked="OperationSwitch_OnChecked" Unchecked="OperationSwitch_OnUnchecked"/>
                            <TextBlock Text="{lex:Loc SortFilter_Filter_Label_FilterOperation}" VerticalAlignment="Center" TextWrapping="Wrap"/>
                        </DockPanel>
                        <CheckBox Content="{lex:Loc SortFilter_Filter_CheckBoxIncludeStandard}" Margin="0,0,0,5" IsChecked="{Binding Path=DeckPickerWildIncludesStandard, Source={StaticResource ConfigWrapper}}"/>
                    </StackPanel>

                    <ListBox Name="ListboxTags" Height="auto" Width="auto" DockPanel.Dock="Top" VirtualizingPanel.IsVirtualizing="False">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <CheckBox Content="{Binding Name}" IsChecked="{Binding Selected}"
                                          Checked="CheckBox_Checked"
                                          Unchecked="CheckBox_Unchecked" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </DockPanel>
            </GroupBox>
        </DockPanel>
    </Grid>
</UserControl>
