<commit_before>﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:viewModels="clr-namespace:IPFilter.ViewModels"
    xmlns:models="clr-namespace:IPFilter.Models"
    x:Class="IPFilter.Views.MainWindow"
    Title="{Binding Update.ProductAndVersion}" Width="716" Loaded="Window_Loaded"
    WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" MinWidth="450" SizeToContent="Height">
    <Window.Resources>
        <Style x:Key="HyperLinkButtonStyle" TargetType="Button">
            <Setter Property="Focusable" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <TextBlock>
                            <Hyperlink>
                                <Run Text="{TemplateBinding Content}" />
                            </Hyperlink>
                        </TextBlock>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="Heading" TargetType="Label">
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Background" Value="LightSlateGray"/>
            <Setter Property="Foreground" Value="WhiteSmoke"/>
            <Setter Property="Margin" Value="0,10,0,0"/>
        </Style>
    </Window.Resources>

    <Window.DataContext>
        <viewModels:MainWindowViewModel>
            <viewModels:MainWindowViewModel.Update>
                <models:UpdateModel CurrentVersion="1.0.0.11" IsUpdateRequired="True" MinimumRequiredVersion="{x:Null}" Product="IPFilter Updater" IsUpdateAvailable="True" UpdateSizeBytes="65535" UpdateAvailableVisibility="Visible"/>
            </viewModels:MainWindowViewModel.Update>
        </viewModels:MainWindowViewModel>
    </Window.DataContext>


    <DockPanel>

        <StackPanel DockPanel.Dock="Top" Margin="5">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="75"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" VerticalAlignment="Bottom" Content="{Binding StatusText}" />
                <Button Grid.Column="1" Width="75" Height="23" Command="{Binding StartCommand}" Content="{Binding ButtonText}" />
            </Grid>

            <ProgressBar Margin="0,5,0,0" IsIndeterminate="{Binding ProgressIsIndeterminate}" Minimum="{Binding ProgressMin}" Maximum="{Binding ProgressMax}" Value="{Binding ProgressValue}" Height="26" VerticalAlignment="Top" />
        </StackPanel>

        <Expander ExpandDirection="Down" IsExpanded="False" Margin="5">
            <Expander.Header>Advanced</Expander.Header>
            <Expander.Content>
                <TabControl Height="350" VerticalAlignment="Stretch" Margin="0,5,0,0">
                    <TabItem Header="Options" Background="Transparent">

                        <DockPanel>
                            <StatusBar DockPanel.Dock="Bottom">
                                <StatusBarItem >
                                    <Button Padding="5" Margin="5" Content="Save Settings" Command="{Binding Options.SaveSettingsCommand}"></Button>
                                </StatusBarItem>
                                <StatusBarItem>
                                    <Label Content="{Binding ErrorMessage}" Foreground="Red" Width="Auto"></Label>
                                </StatusBarItem>
                                <StatusBarItem HorizontalAlignment="Right">
                                    <Button Padding="5" Margin="5" Content="Cancel" Command="{Binding Options.ResetSettingsCommand}"></Button>
                                </StatusBarItem>
                            </StatusBar>

                            <ScrollViewer>

                                <StackPanel CanVerticallyScroll="True" Orientation="Vertical" Margin="5,0,5,5">

                                    <Label Content="Filter Source" Style="{StaticResource Heading}" />

                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="49*"/>
                                            <ColumnDefinition Width="292*"/>
                                        </Grid.ColumnDefinitions>
                                        <ComboBox Height="23" Margin="24,12,12,0" ItemsSource="{Binding MirrorProviders}" VerticalAlignment="Top" SelectedItem="{Binding SelectedMirrorProvider}" Grid.Column="1">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Name}" />
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                        <Label Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" VerticalAlignment="Top" Width="104" Content="List Provider:" Grid.ColumnSpan="2"/>

                                        <Label Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" VerticalAlignment="Top" Width="104" Content="List:" Grid.ColumnSpan="2"/>
                                        <ComboBox Height="23" Margin="24,41,12,0" ItemsSource="{Binding Mirrors}" SelectedItem="{Binding SelectedFileMirror}" VerticalAlignment="Top" Grid.Column="1" />

                                    </Grid>

                                    <Label Style="{StaticResource Heading}" Content="Automatic list update" />

                                    <StackPanel Orientation="Horizontal" Margin="10">
                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Options.IsScheduleEnabled}"></CheckBox>
                                        <Label Content="Schedule silent update of list every: " />
                                        <xctk:IntegerUpDown IsEnabled="{Binding Options.IsScheduleEnabled}" Value="{Binding Options.ScheduleHours}" Maximum="24" Minimum="1"></xctk:IntegerUpDown>
                                        <Label Content="hour(s)" />
                                    </StackPanel>

                                    <Label Content="Custom Paths" Style="{StaticResource Heading}" />

                                    <DataGrid AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" ItemsSource="{Binding Options.Paths}" CanUserAddRows="True" CanUserDeleteRows="True">
                                        <DataGrid.Columns>
                                            <DataGridTextColumn Binding="{Binding Name}" Width="Auto" Header="Name"></DataGridTextColumn>
                                            <DataGridTextColumn Binding="{Binding Path}" Width="*" Header="Path"></DataGridTextColumn>
                                            <DataGridTemplateColumn Width="Auto" Header="">
                                                <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <Button Content="..."/>
                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
                                            </DataGridTemplateColumn>
                                            <DataGridTemplateColumn Width="Auto" Header="">
                                                <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>

                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
                                            </DataGridTemplateColumn>

                                        </DataGrid.Columns>

                                    </DataGrid>
                                </StackPanel>


                            </ScrollViewer>

                        </DockPanel>
                    </TabItem>
                    <TabItem Header="Log" Background="Transparent">
                        <TextBox Text="{Binding LogData, Mode=OneWay}" IsReadOnly="True" />
                    </TabItem>
                    <TabItem Header="Help" Background="Transparent">

                        <TextBlock>
                            Documentation &amp; Support: <Hyperlink NavigateUri="http://davidmoore.github.io/ipfilter/" RequestNavigate="LaunchHelp">http://davidmoore.github.io/ipfilter/</Hyperlink>
                        </TextBlock>

                    </TabItem>
                </TabControl>
            </Expander.Content><commit_msg>Show latest version in the Help tab<commit_after>﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:viewModels="clr-namespace:IPFilter.ViewModels"
    xmlns:models="clr-namespace:IPFilter.Models"
    x:Class="IPFilter.Views.MainWindow"
    Title="{Binding Update.ProductAndVersion}" Width="716" Loaded="Window_Loaded"
    WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" MinWidth="450" SizeToContent="Height" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <Style x:Key="HyperLinkButtonStyle" TargetType="Button">
            <Setter Property="Focusable" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <TextBlock>
                            <Hyperlink>
                                <Run Text="{TemplateBinding Content}" />
                            </Hyperlink>
                        </TextBlock>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="Heading" TargetType="Label">
            <Setter Property="FontSize" Value="14" />
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Background" Value="LightSlateGray"/>
            <Setter Property="Foreground" Value="WhiteSmoke"/>
            <Setter Property="Margin" Value="0,10,0,0"/>
        </Style>
    </Window.Resources>

    <Window.DataContext>
        <viewModels:MainWindowViewModel>
            <viewModels:MainWindowViewModel.Update>
                <models:UpdateModel IsUpdateRequired="True" MinimumRequiredVersion="{x:Null}" Product="IPFilter Updater" IsUpdateAvailable="True" UpdateSizeBytes="65535">
                    
                </models:UpdateModel>
            </viewModels:MainWindowViewModel.Update>
        </viewModels:MainWindowViewModel>
    </Window.DataContext>


    <DockPanel>

        <StackPanel DockPanel.Dock="Top" Margin="5">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="75"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" VerticalAlignment="Bottom" Content="{Binding StatusText}" />
                <Button Grid.Column="1" Width="75" Height="23" Command="{Binding StartCommand}" Content="{Binding ButtonText}" />
            </Grid>

            <ProgressBar Margin="0,5,0,0" IsIndeterminate="{Binding ProgressIsIndeterminate}" Minimum="{Binding ProgressMin}" Maximum="{Binding ProgressMax}" Value="{Binding ProgressValue}" Height="26" VerticalAlignment="Top" />
        </StackPanel>

        <Expander ExpandDirection="Down" IsExpanded="False" Margin="5">
            <Expander.Header>Advanced</Expander.Header>
            <Expander.Content>
                <TabControl Height="350" VerticalAlignment="Stretch" Margin="0,5,0,0">
                    <TabItem Header="Options" Background="Transparent">

                        <DockPanel>
                            <StatusBar DockPanel.Dock="Bottom">
                                <StatusBarItem >
                                    <Button Padding="5" Margin="5" Content="Save Settings" Command="{Binding Options.SaveSettingsCommand}"></Button>
                                </StatusBarItem>
                                <StatusBarItem>
                                    <Label Content="{Binding ErrorMessage}" Foreground="Red" Width="Auto"></Label>
                                </StatusBarItem>
                                <StatusBarItem HorizontalAlignment="Right">
                                    <Button Padding="5" Margin="5" Content="Cancel" Command="{Binding Options.ResetSettingsCommand}"></Button>
                                </StatusBarItem>
                            </StatusBar>

                            <ScrollViewer>

                                <StackPanel CanVerticallyScroll="True" Orientation="Vertical" Margin="5,0,5,5">

                                    <Label Content="Filter Source" Style="{StaticResource Heading}" />

                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="49*"/>
                                            <ColumnDefinition Width="292*"/>
                                        </Grid.ColumnDefinitions>
                                        <ComboBox Height="23" Margin="24,12,12,0" ItemsSource="{Binding MirrorProviders}" VerticalAlignment="Top" SelectedItem="{Binding SelectedMirrorProvider}" Grid.Column="1">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Name}" />
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                        <Label Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" VerticalAlignment="Top" Width="104" Content="List Provider:" Grid.ColumnSpan="2"/>

                                        <Label Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" VerticalAlignment="Top" Width="104" Content="List:" Grid.ColumnSpan="2"/>
                                        <ComboBox Height="23" Margin="24,41,12,0" ItemsSource="{Binding Mirrors}" SelectedItem="{Binding SelectedFileMirror}" VerticalAlignment="Top" Grid.Column="1" />

                                    </Grid>

                                    <Label Style="{StaticResource Heading}" Content="Automatic list update" />

                                    <StackPanel Orientation="Horizontal" Margin="10">
                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Options.IsScheduleEnabled}"></CheckBox>
                                        <Label Content="Schedule silent update of list every: " />
                                        <xctk:IntegerUpDown IsEnabled="{Binding Options.IsScheduleEnabled}" Value="{Binding Options.ScheduleHours}" Maximum="24" Minimum="1"></xctk:IntegerUpDown>
                                        <Label Content="hour(s)" />
                                    </StackPanel>

                                    <Label Content="Custom Paths" Style="{StaticResource Heading}" />

                                    <DataGrid AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" ItemsSource="{Binding Options.Paths}" CanUserAddRows="True" CanUserDeleteRows="True">
                                        <DataGrid.Columns>
                                            <DataGridTextColumn Binding="{Binding Name}" Width="Auto" Header="Name"></DataGridTextColumn>
                                            <DataGridTextColumn Binding="{Binding Path}" Width="*" Header="Path"></DataGridTextColumn>
                                            <DataGridTemplateColumn Width="Auto" Header="">
                                                <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <Button Content="..."/>
                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
                                            </DataGridTemplateColumn>
                                            <DataGridTemplateColumn Width="Auto" Header="">
                                                <DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>

                                                    </DataTemplate>
                                                </DataGridTemplateColumn.CellTemplate>
                                            </DataGridTemplateColumn>

                                        </DataGrid.Columns>

                                    </DataGrid>
                                </StackPanel>


                            </ScrollViewer>

                        </DockPanel>
                    </TabItem>
                    <TabItem Header="Log" Background="Transparent">
                        <TextBox Text="{Binding LogData, Mode=OneWay}" IsReadOnly="True" />
                    </TabItem>
                    <TabItem Header="Help" Background="Transparent">



                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                                <RowDefinition Height="Auto"></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="292*"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.ColumnSpan="2" Padding="5">
                            Documentation &amp; Support: <Hyperlink NavigateUri="http://davidmoore.github.io/ipfilter/" RequestNavigate="LaunchHelp">http://davidmoore.github.io/ipfilter/</Hyperlink>
                            </TextBlock>
                            
                            <Label Content="Current version:" Grid.Row="1"></Label>
                            <Label Content="{Binding Update.CurrentVersion}" Grid.Row="1" Grid.Column="1"></Label>
                            
<!--                            <Label Content="Latest available version:" Grid.Row="2"></Label>-->
<!---->
<!--                            <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">-->
<!--                                <Label Content="{Binding Update.AvailableVersion}"></Label>-->
<!--                                <Button Content="Update Now" Visibility="{Binding Update.UpdateAvailableVisibility}" Command="{Binding Update.UpdateCommand}"></Button>-->
<!--                            </StackPanel>-->
<!---->
<!--                            <ProgressBar Height="20" Margin="5" Visibility="{Binding Update.UpdateAvailableVisibility}" Minimum="0" Maximum="100" Grid.Row="3" Grid.Column="1"></ProgressBar>-->
<!---->
<!--                            <Label Content="{Binding Update.ErrorMessage}" Foreground="Red" Padding="5" Grid.Row="4" Grid.ColumnSpan="2"></Label>-->

                        </Grid>
                    </TabItem>
                </TabControl>
            </Expander.Content>
{'fraction_non_alphanumeric': 0.1115908980641405, 'fraction_numerical': 0.012129445441754403, 'mean_word_length': 1.3484106186624132, 'pattern_counts': {'":': 0, '<': 310, '<?xml version=': 0, '>': 310, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 146, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4213224', 'n_tokens_mistral': 4610, 'n_tokens_neox': 4101, 'n_words': 708}