<PopupCarFilter xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:ForzaUI;assembly="
                x:Class="ForzaUI.Scenes.Anthem.A_CarFilter"
                Style="{StaticResource A_Style_Page_Generic}"
                DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <PopupCarFilter.Resources>
        <ResourceDictionary>
            <MappingConverter
                x:Key="A_Converter_MapFilterCategoryToIcon"
                Default="all">
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.All}"
                    Value="all" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.FestivalSites}"
                    Value="festivalsites" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.SeasonEvents}"
                    Value="seasonevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.EvolvingWorld}"
                    Value="evolvingworld" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.ActiveWristbandEvents}"
                    Value="activewristbandevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.AsphaltSeries}"
                    Value="asphaltseries" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.MixedSurfaceSeries}"
                    Value="mixedsurfaceseries" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.CrossCountrySeries}"
                    Value="crosscountryseries" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.TougeRacingEvents}"
                    Value="tougeracingevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.StreetRacing}"
                    Value="streetracing" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.DragStrip}"
                    Value="dragstrip" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.ShowcaseEvents}"
                    Value="showcaseevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.TimeAttack}"
                    Value="timeattack" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.DragMeets}"
                    Value="dragmeets" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.SpeedTraps}"
                    Value="speedtraps" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.SpeedZones}"
                    Value="speedzones" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.DangerSigns}"
                    Value="dangersigns" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.DriftZones}"
                    Value="driftzones" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.Trailblazer}"
                    Value="trailblazer" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.IncompleteEvents}"
                    Value="incompleteevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.RewardBoards}"
                    Value="rewardboards" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.CollectedRewardBoards}"
                    Value="collectedrewardboards" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.Mascots}"
                    Value="mascots" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.CollectedMascots}"
                    Value="collectedmascots" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.BarnFinds}"
                    Value="barnfinds" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.TreasureCars}"
                    Value="treasurecars" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.AftermarketCars}"
                    Value="aftermarketcars" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.HorizonStories}"
                    Value="horizonstories" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.Jobs}"
                    Value="jobs" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.Landmarks}"
                    Value="landmarks" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.PlayerHouses}"
                    Value="playerhouses" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.CarMeets}"
                    Value="carmeets" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.MultiplayerEvents}"
                    Value="multiplayerevents" />
                <MappingConverterEntry
                    Key="{x:Static local:XAMLMapFilterCategory.OtherDrivers}"
                    Value="otherdrivers" />
            </MappingConverter>
            <Style
                x:Key="A_Style_FZMaterial_FilterIcon"
                TargetType="local:FZMaterial">
                <Setter
                    Property="local:MultiStringFormatter.Format">
                    <Setter.Value>
                        <String>{0}{1}.png</String>
                    </Setter.Value>
                </Setter>
                <Setter
                    Property="ImageSource"
                    Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}" />
                <Setter
                    Property="Visibility"
                    Value="Collapsed" />
                <Setter
                    Property="Width"
                    Value="42" />
                <Setter
                    Property="Height"
                    Value="42" />
                <Setter
                    Property="Margin"
                    Value="24,3,-12,3" />
                <Setter
                    Property="Color"
                    Value="#FFFFFF" />
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding CategoryIconSet, RelativeSource={RelativeSource AncestorType=Page}}"
                        Value="map">
                        <Setter
                            Property="local:MultiStringFormatter.Param0"
                            Value="{Binding ActiveTrack, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_ActiveTrackToMapFilterIconLocation}}" />
                        <Setter
                            Property="local:MultiStringFormatter.Param1"
                            Value="{Binding Category, Converter={StaticResource A_Converter_MapFilterCategoryToIcon}}" />
                        <Setter
                            Property="Visibility"
                            Value="Visible" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding Category}"
                                Value="{x:Static local:XAMLMapFilterCategory.All}" />
                            <Condition
                                Binding="{Binding CategoryIconSet, RelativeSource={RelativeSource AncestorType=Page}}"
                                Value="map" />
                            <Condition
                                Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                Value="False" />
                        </MultiDataTrigger.Conditions>
                        <Setter
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Black}" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>
            <Style
                x:Key="A_Style_ListBoxItem_CarFilterItem"
                BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Default}"
                TargetType="ListBoxItem">
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding IsToggle}"
                        Value="False">
                        <Setter
                            Property="Focusable"
                            Value="False" />
                        <Setter
                            Property="Tag"
                            Value="GroupHeader" />
                        <Setter
                            Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                <Grid>
                                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill_Green}"/>
                                    <ContentPresenter
                                        Focusable="{Binding Focusable, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                        x:Name="Presenter"
                                        PropertySetter.Value="{Binding IsKeyboardFocused, RelativeSource={RelativeSource Self}}"
                                        PropertySetter.Property="Content.(FocusSelf.WhenTrue)"/>
                                </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
                <Setter
                    Property="Margin"
                    Value="0,0,0,4" />
            </Style>
            <Double
                x:Key="A_Double_TextMenu_Height_Large">50</Double>
            <MappingConverter
                x:Key="A_Converter_CategoryIconSetToListBoxItemHeight"
                Default="{StaticResource A_Double_TextMenu_Height_Large}">
                <MappingConverterEntry
                    Key=""
                    Value="{StaticResource A_Double_TextMenu_Height_Default}" />
            </MappingConverter>
            <Double
                x:Key="A_Double_ListBox_Height_Normal">648</Double>
            <Double
                x:Key="A_Double_ListBox_Height_Large">648</Double>
            <MappingConverter
                x:Key="A_Converter_CategoryIconSetToListBoxMaxHeight"
                Default="{StaticResource A_Double_ListBox_Height_Large}">
                <MappingConverterEntry
                    Key=""
                    Value="{StaticResource A_Double_ListBox_Height_Normal}" />
            </MappingConverter>
            <DataTemplate
                x:Key="A_DataTemplate_ListBoxItem_CarFilterItem">
                <Grid
                    IsHitTestVisible="False"
                    Height="{Binding CategoryIconSet, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_CategoryIconSetToListBoxItemHeight}}"
                    x:Name="ItemContainer">
                    <DockPanel>
                        <FZMaterial
                            Style="{StaticResource A_Style_FZMaterial_FilterIcon}"/>
                        <FZTextBlock
                            x:Name="Text"
                            Text="{Binding Text}"
                            Style="{StaticResource A_Style_FZTextBlock_OptionText}"
                            Margin="25,0,16,0"
                            HorizontalAlignment="Stretch"
                            FontFamily="Horizon_B" />
                    </DockPanel>
                    <Decorator
                        HorizontalAlignment="Right"
                        Visibility="{Binding IsToggle, Converter={StaticResource A_Converter_BoolToVis}}"
                        Margin="0,0,24,0">
                        <Control
                            x:Name="CheckBox"
                            VerticalAlignment="Center"
                            Style="{StaticResource A_Style_Control_Checkbox}"
                            Tag="{Binding Value}" />
                    </Decorator>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger
                        Binding="{Binding Focusable, RelativeSource={RelativeSource TemplatedParent}}"
                        Value="False" />
                    <DataTrigger
                        Binding="{Binding IsToggle}"
                        Value="False">
                        <Setter
                            TargetName="Text"
                            Property="TextAlignment"
                            Value="Center" />
                        <Setter
                            TargetName="Text"
                            Property="FontFamily"
                            Value="Horizon_A" />
                        <Setter
                            TargetName="Text"
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Black}" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
            <ControlTemplate
                TargetType="{Type ListBox}"
                x:Key="A_Template_ListBox_FilterPopup">
                <Border
                    Background="{Null}">
                    <FZScrollViewer
                        Template="{StaticResource A_ControlTemplate_ScrollViewer_Popup_ExternalRightPosition}"
                        CanContentScroll="True"
                        Margin="-18,0"
                        HorizontalScrollBarVisibility="Disabled"
                        VerticalScrollBarVisibility="{Binding (ScrollViewer.VerticalScrollBarVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                        IsAtTop="{Binding (local:FZScrollViewer.IsAtTop), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                        IsAtBottom="{Binding (local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                        Focusable="False"
						DragMovementMultiplier="0.03"
                        KeepSelectionOnScreen="True">
                        <VirtualizingStackPanel
                            Orientation="Vertical"
                            Margin="0,0,0,0"
                            IsItemsHost="True"
                            VirtualizationMode="Recycling"
                            Focusable="False" />
                    </FZScrollViewer>
                </Border>
            </ControlTemplate>
        </ResourceDictionary>
    </PopupCarFilter.Resources>
    <UIPageTransitionManager.TransitionManager>
        <UIPageTransitionManager
            Preset="{StaticResource A_UIPageTransitionManagerPreset_Popup}" />
    </UIPageTransitionManager.TransitionManager>
    <Grid>
        <Grid>
            <FZMaterialGlassCapture />
            <FZMaterial
                Style="{StaticResource A_Style_FZMaterial_Popup_Background}"
                MinWidth="{Binding ActualWidth, ElementName=MainContent}"
                MinHeight="{Binding ActualHeight, ElementName=MainContent}" />
            <ContentControl
                x:Name="BottomBar"
                Style="{StaticResource A_Style_ButtonBar}">
                <ContentControl
                    x:Name="PART_DefaultHelpPanel"
                    ControllerButtonPanel.ADescription="{Loc HelpButtons.IDS_Toggle}"
                    ControllerButtonPanel.BDescription="{Loc HelpButtons.IDS_Back}"
                    ControllerButtonPanel.XDescription="{Loc HelpButtons.IDS_ClearAll}"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
            </ContentControl>
        </Grid>
        <Grid
            Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}"
            Focusable="False">
            <StackPanel
                x:Name="MainContent"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                Width="{StaticResource A_Double_Default_TitleBlock_Width}">
                <ContentControl
                    Content="{Binding Title}"
                    Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}" />
                    <Grid
                        local:ScreenReader.LineType="SelectedGroup"
                        local:ScreenReader.Event="OnChange"
                        local:ScreenReader.Line="{Binding ElementName=PART_Menu, Path=SelectedItem.CategoryName}">
                        <CommonListBox
                            x:Name="PART_Menu"
                            Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                            ItemContainerStyle="{StaticResource A_Style_ListBoxItem_CarFilterItem}"
                            ItemTemplate="{StaticResource A_DataTemplate_ListBoxItem_CarFilterItem}"
                            ItemsSource="{Binding Collection}"
                            MaxHeight="{Binding CategoryIconSet, Converter={StaticResource A_Converter_CategoryIconSetToListBoxMaxHeight}}"
                            Template="{StaticResource A_Template_ListBox_FilterPopup}"
                            SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
                            local:ScreenReader.LineType="SelectedItem"
                            local:ScreenReader.Event="OnChange"
                            local:ScreenReader.Line="{Binding SelectedItem.Text, RelativeSource={RelativeSource Self}}"
                            Width="632"/>
                    </Grid>
            </StackPanel>
        </Grid>
    </Grid>
</PopupCarFilter>