<Page
    x:Class="Nickvision.Parabolic.WinUI.Views.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Nickvision.Parabolic.WinUI.Views"
    xmlns:nickvision="using:Nickvision.Desktop.WinUI.Controls"
    xmlns:helpers="using:Nickvision.Desktop.WinUI.Helpers"
    xmlns:community="using:CommunityToolkit.WinUI.Controls"
    xmlns:parabolic="using:Nickvision.Parabolic.WinUI.Helpers"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Loaded="Page_Loaded" Unloaded="Page_Unloaded">

    <Grid>
        <NavigationView x:Name="NavigationView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                        IsPaneToggleButtonVisible="False" IsBackButtonVisible="Collapsed" IsSettingsVisible="False"
                        PaneDisplayMode="Left" SelectionChanged="NavigationView_SelectionChanged">
            <NavigationView.Resources>
                <SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent"/>
                <SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent"/>
            </NavigationView.Resources>

            <NavigationView.MenuItems>
                <NavigationViewItem x:Name="NavUserInterface" Tag="0" IsSelected="True">
                    <NavigationViewItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE790;"/>
                    </NavigationViewItem.Icon>
                </NavigationViewItem>

                <NavigationViewItem x:Name="NavDownloads" Tag="1">
                    <NavigationViewItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8FD;"/>
                    </NavigationViewItem.Icon>
                </NavigationViewItem>

                <NavigationViewItem x:Name="NavDownloader" Tag="2">
                    <NavigationViewItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE896;"/>
                    </NavigationViewItem.Icon>
                </NavigationViewItem>

                <NavigationViewItem x:Name="NavConverter" Tag="3">
                    <NavigationViewItem.Icon>
                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE90F;"/>
                    </NavigationViewItem.Icon>
                </NavigationViewItem>
            </NavigationView.MenuItems>

            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                <nickvision:ViewStack x:Name="ViewStack" Margin="12,12,12,12">
                    <nickvision:ViewStack.Pages>
                        <StackPanel Spacing="6">
                            <StackPanel.Transitions>
                                <TransitionCollection>
                                    <EntranceThemeTransition/>
                                </TransitionCollection>
                            </StackPanel.Transitions>

                            <community:SettingsCard x:Name="RowTheme">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE793;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbTheme" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowTranslationLanguage">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF2B7;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbTranslationLanguage" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreviewUpdates">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF1AD;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglPreviewUpdates" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreventSuspend">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE7E8;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglPreventSuspend" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowHistoryLength">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE81C;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbHistoryLength" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>
                        </StackPanel>

                        <StackPanel Spacing="6">
                            <StackPanel.Transitions>
                                <TransitionCollection>
                                    <EntranceThemeTransition/>
                                </TransitionCollection>
                            </StackPanel.Transitions>

                            <community:SettingsCard x:Name="RowActiveDownloads">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE896;"/>
                                </community:SettingsCard.HeaderIcon>

                                <NumberBox x:Name="NumActiveDownloads" Minimum="1" Maximum="10" SpinButtonPlacementMode="Inline" ValueChanged="Num_ValueChanged"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowOverwriteFiles">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8E5;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglOverwriteFiles" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowIncludeMediaId">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8AC;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglIncludeMediaId" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowIncludeAutoSubtitles">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xED1E;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglIncludeAutoSubtitles" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowIncludeSuperResolutions">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF7EE;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglIncludeSuperResolutions" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreferredVideoCodec">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE714;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbPreferredVideoCodec" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreferredAudioCodec">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8D6;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbPreferredAudioCodec" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreferredSubtitleFormat">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xED1F;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbPreferredSubtitleFormat" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowPreferredFrameRate">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE722;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbPreferredFrameRate" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>
                        </StackPanel>

                        <StackPanel Spacing="6">
                            <StackPanel.Transitions>
                                <TransitionCollection>
                                    <EntranceThemeTransition/>
                                </TransitionCollection>
                            </StackPanel.Transitions>

                            <community:SettingsCard x:Name="RowUsePartFiles">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8A5;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglUsePartFiles" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowUseSponsorBlock">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE789;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglUseSponsorBlock" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowLimitSpeed">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xEBD3;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglLimitSpeed" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowSpeedLimit" IsEnabled="{x:Bind TglLimitSpeed.IsOn, Mode=OneWay}">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xEC49;"/>
                                </community:SettingsCard.HeaderIcon>

                                <NumberBox x:Name="NumSpeedLimit" Minimum="512" Maximum="10240" SmallChange="512" LargeChange="1024"
                               SpinButtonPlacementMode="Inline" ValueChanged="Num_ValueChanged"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowProxyUrl">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE71B;"/>
                                </community:SettingsCard.HeaderIcon>

                                <TextBox x:Name="TxtProxyUrl" TextChanged="Txt_TextChanged"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowCookiesFile">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8A6;"/>
                                </community:SettingsCard.HeaderIcon>

                                <StackPanel Orientation="Horizontal" Spacing="6">
                                    <TextBlock x:Name="LblCookiesFile" VerticalAlignment="Center"/>

                                    <Button x:Name="BtnSelectCookiesFile" Click="SelectCookiesFile">
                                        <Button.Content>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8E5;" FontSize="18"/>
                                        </Button.Content>
                                    </Button>

                                    <Button x:Name="BtnClearCookiesFile" Click="ClearCookiesFile">
                                        <Button.Content>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE894;" FontSize="18"/>
                                        </Button.Content>
                                    </Button>
                                </StackPanel>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowCookiesBrowser">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE774;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ComboBox x:Name="CmbCookiesBrowser" SelectionChanged="Cmb_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                                            <TextBlock Text="{x:Bind Label}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </community:SettingsCard>

                            <TextBlock x:Name="LblAria" Margin="0,12,0,0" Style="{StaticResource NavigationViewItemHeaderTextStyle}"/>

                            <community:SettingsExpander x:Name="RowUseAria">
                                <community:SettingsExpander.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE756;"/>
                                </community:SettingsExpander.HeaderIcon>

                                <ToggleSwitch x:Name="TglUseAria" Toggled="Tgl_Toggled"/>

                                <community:SettingsExpander.Items>
                                    <community:SettingsCard x:Name="RowMaxConnectionsPerServer" IsEnabled="{x:Bind TglUseAria.IsOn, Mode=OneWay}">
                                        <community:SettingsCard.HeaderIcon>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF0B9;"/>
                                        </community:SettingsCard.HeaderIcon>

                                        <NumberBox x:Name="NumMaxConnectionsPerServer" Minimum="1" Maximum="16" SpinButtonPlacementMode="Inline" ValueChanged="Num_ValueChanged"/>
                                    </community:SettingsCard>

                                    <community:SettingsCard x:Name="RowMinimumSplitSize" IsEnabled="{x:Bind TglUseAria.IsOn, Mode=OneWay}">
                                        <community:SettingsCard.HeaderIcon>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8C6;"/>
                                        </community:SettingsCard.HeaderIcon>

                                        <NumberBox x:Name="NumMinimumSplitSize" Minimum="1" Maximum="1024" LargeChange="128" SpinButtonPlacementMode="Inline" ValueChanged="Num_ValueChanged"/>
                                    </community:SettingsCard>
                                </community:SettingsExpander.Items>
                            </community:SettingsExpander>

                            <TextBlock x:Name="LblAdvanced" Margin="0,12,0,0" Style="{StaticResource NavigationViewItemHeaderTextStyle}"/>

                            <community:SettingsCard x:Name="RowYtdlpDiscoveryArgs">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE756;"/>
                                </community:SettingsCard.HeaderIcon>

                                <TextBox x:Name="TxtYtdlpDiscoveryArgs" TextChanged="Txt_TextChanged"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowYtdlpDownloadArgs">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE756;"/>
                                </community:SettingsCard.HeaderIcon>

                                <TextBox x:Name="TxtYtdlpDownloadArgs" TextChanged="Txt_TextChanged"/>
                            </community:SettingsCard>
                        </StackPanel>

                        <StackPanel Spacing="6">
                            <StackPanel.Transitions>
                                <TransitionCollection>
                                    <EntranceThemeTransition/>
                                </TransitionCollection>
                            </StackPanel.Transitions>

                            <community:SettingsCard x:Name="RowTranslateMetadataAndChapters">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF2B7;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglTranslateMetadataAndChapters" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsExpander x:Name="RowEmbedMetadata">
                                <community:SettingsExpander.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8EC;"/>
                                </community:SettingsExpander.HeaderIcon>

                                <ToggleSwitch x:Name="TglEmbedMetadata" Toggled="Tgl_Toggled"/>

                                <community:SettingsExpander.Items>
                                    <community:SettingsCard x:Name="RowRemoveSourceData" IsEnabled="{x:Bind TglEmbedMetadata.IsOn, Mode=OneWay}">
                                        <community:SettingsCard.HeaderIcon>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE74D;"/>
                                        </community:SettingsCard.HeaderIcon>

                                        <ToggleSwitch x:Name="TglRemoveSourceData" Toggled="Tgl_Toggled"/>
                                    </community:SettingsCard>
                                </community:SettingsExpander.Items>
                            </community:SettingsExpander>

                            <community:SettingsExpander x:Name="RowEmbedThumbnails">
                                <community:SettingsExpander.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8B9;"/>
                                </community:SettingsExpander.HeaderIcon>

                                <ToggleSwitch x:Name="TglEmbedThumbnails" Toggled="Tgl_Toggled"/>

                                <community:SettingsExpander.Items>
                                    <community:SettingsCard x:Name="RowCropAudioThumbnails" IsEnabled="{x:Bind TglEmbedThumbnails.IsOn, Mode=OneWay}">
                                        <community:SettingsCard.HeaderIcon>
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE7A8;"/>
                                        </community:SettingsCard.HeaderIcon>

                                        <ToggleSwitch x:Name="TglCropAudioThumbnails" Toggled="Tgl_Toggled"/>
                                    </community:SettingsCard>
                                </community:SettingsExpander.Items>
                            </community:SettingsExpander>

                            <community:SettingsCard x:Name="RowEmbedChapters">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF168;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglEmbedChapters" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowEmbedSubtitles">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xED1E;"/>
                                </community:SettingsCard.HeaderIcon>

                                <ToggleSwitch x:Name="TglEmbedSubtitles" Toggled="Tgl_Toggled"/>
                            </community:SettingsCard>

                            <community:SettingsCard x:Name="RowFfmpegThreads">
                                <community:SettingsCard.HeaderIcon>
                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xEEA1;"/>
                                </community:SettingsCard.HeaderIcon>

                                <NumberBox x:Name="NumFfmpegThreads" Minimum="1" SpinButtonPlacementMode="Inline" ValueChanged="Num_ValueChanged"/>
                            </community:SettingsCard>

                            <Grid Margin="0,12,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock x:Name="LblPostProcessorArgments" Grid.Column="0" VerticalAlignment="Center" Style="{StaticResource NavigationViewItemHeaderTextStyle}"/>

                                <Button x:Name="BtnAddPostProcessorArgument" Grid.Column="1" Click="AddPostprocessingArgument">
                                    <Button.Content>
                                        <StackPanel Orientation="Horizontal" Spacing="6">
                                            <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE710;" FontSize="18"/>

                                            <TextBlock x:Name="LblAddPostProcessorArgument"/>
                                        </StackPanel>
                                    </Button.Content>
                                </Button>
                            </Grid>

                            <ListView x:Name="ListPostProcessorArguments" SelectionMode="None">
                                <ListView.ItemTemplate>
                                    <DataTemplate x:DataType="parabolic:BindablePostProcessorArgument">
                                        <community:SettingsCard Margin="-16,6,-12,0" Header="{x:Bind Name, Mode=OneWay}" Description="{x:Bind Args, Mode=OneWay}">
                                            <community:SettingsCard.HeaderIcon>
                                                <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE90F;"/>
                                            </community:SettingsCard.HeaderIcon>
                                            
                                            <StackPanel Orientation="Horizontal" Spacing="6">
                                                <Button Tag="{x:Bind Name, Mode=OneWay}" Click="EditPostprocessingArgument">
                                                    <Button.Content>
                                                        <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE70F;" FontSize="18"/>
                                                    </Button.Content>
                                                </Button>

                                                <Button Tag="{x:Bind Name, Mode=OneWay}" Click="DeletePostprocessingArgument">
                                                    <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE74D;" FontSize="18"/>
                                                </Button>
                                            </StackPanel>
                                        </community:SettingsCard>
                                    </DataTemplate>
                                </ListView.ItemTemplate>
                            </ListView>
                        </StackPanel>
                    </nickvision:ViewStack.Pages>
                </nickvision:ViewStack>
            </ScrollViewer>
        </NavigationView>
    
        <ContentDialog x:Name="DlgPostprocessingArgument" DefaultButton="Primary">
            <StackPanel Orientation="Vertical" Spacing="12">
                <TextBox x:Name="TxtPostprocessingArgumentName"/>

                <ComboBox x:Name="CmbPostprocessingArgumentPostProcessor" HorizontalAlignment="Stretch">
                    <ComboBox.ItemTemplate>
                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                            <TextBlock Text="{x:Bind Label}"/>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <ComboBox x:Name="CmbPostprocessingArgumentExecutable" HorizontalAlignment="Stretch">
                    <ComboBox.ItemTemplate>
                        <DataTemplate x:DataType="helpers:BindableSelectionItem">
                            <TextBlock Text="{x:Bind Label}"/>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBox x:Name="TxtPostprocessingArgumentArgs"/>
            </StackPanel>
        </ContentDialog>
    </Grid>
</Page>