<commit_before>﻿<src:OverlayWindow x:Class="GW2PAO.Modules.Dungeons.Views.DungeonTrackerView"
        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:src="clr-namespace:GW2PAO.Views"
        xmlns:view="clr-namespace:GW2PAO.Modules.Dungeons.Views"
        xmlns:converters="clr-namespace:GW2PAO.Converters"
        xmlns:properties="clr-namespace:GW2PAO.Properties"
        xmlns:resx="clr-namespace:GW2PAO.Properties"
        xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        d:DesignHeight="200"
        Top="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerY}"
        Left="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerX}"
        MinWidth="150" MaxWidth="350" Width="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerWidth}"
        WindowStyle="None" AllowsTransparency="true" Background="Transparent"
        ResizeMode="CanResizeWithGrip"
        Topmost="True"
        Closed="Window_Closed"
        UseLayoutRounding="True"
        SnapsToDevicePixels="True"
        TextOptions.TextFormattingMode="Display">
    
    <src:OverlayWindow.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
        <core:AutoRefreshCollectionViewSource Source="{Binding Dungeons}" x:Key="DungeonsCollection" />
    </src:OverlayWindow.Resources>

    <Grid Name="MainPanel">

        <Grid.Background>
            <SolidColorBrush Color="#01000000" />
        </Grid.Background>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Border Name="TitleBar"
                MouseLeftButtonDown="TitleBar_MouseLeftButtonDown"
                MouseLeftButtonUp="TitleBar_MouseLeftButtonUp"
                Grid.Row="0">
            <Grid Margin="5,0,0,0">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Image Name="TitleImage"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Height="30" Width="30"
                        Margin="0,0,0,0"
                        Source="/Images/Title/dungeons.png"
                        MouseDown="TitleImage_MouseDown">
                    <Image.ContextMenu>
                        <ContextMenu Name="MainMenu">
                            <MenuItem Header="{x:Static resx:Resources.ResetHiddenDungeons}" Command="{Binding ResetHiddenDungeonsCommand}" />
                            <MenuItem Header="{x:Static resx:Resources.ResetCompletedPaths}" Command="{Binding ResetCompletedPathsCommand}" />
                            <Separator />
                            <MenuItem Header="{x:Static resx:Resources.Close}" Click="CloseWindowButton_Click" />
                        </ContextMenu>
                    </Image.ContextMenu>
                    <Image.Style>
                        <Style TargetType="{x:Type Image}">
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect ShadowDepth="0"
                                                Color="LightGreen"
                                                Opacity="0"
                                                BlurRadius="7"/>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Trigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation To="1"
                                                            Storyboard.TargetProperty="(Effect).Opacity"
                                                            Duration="00:00:00.1"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation To="0"
                                                            Storyboard.TargetProperty="(Effect).Opacity"
                                                            Duration="00:00:0.1"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.ExitActions>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>
                </Image>

                <core:OutlinedTextBlock Grid.Column="1" Margin="5,0,0,0"
                                        VerticalAlignment="Center"
                                        Fill="PaleGoldenrod" FontFamily="Candara" FontSize="17"
                                        Text="{x:Static resx:Resources.Dungeons}" />

                <Button Name="CollapseExpandButton"
                        Grid.Column="2"
                        Margin="3"
                        Click="CollapseExpandButton_Click">
                    <Button.Style>
                        <Style TargetType="Button" BasedOn="{StaticResource TitleBarButtonStyle}">
                            <Setter Property="Content" Value="{StaticResource CollapseGraphic}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Visibility, ElementName=DungeonsContainer}" Value="Collapsed">
                                    <DataTrigger.Setters>
                                        <Setter Property="Content" Value="{StaticResource ExpandGraphic}" />
                                    </DataTrigger.Setters>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Button.Style>
                </Button>

                <Button Name="CloseWindowButton"
                        Grid.Column="3"
                        Margin="3,3,5,3"
                        Style="{StaticResource TitleBarButtonStyle}"
                        Content="{StaticResource CloseGraphic}"
                        Click="CloseWindowButton_Click" />
            </Grid>
            <Border.Style>
                <Style TargetType="Border" BasedOn="{StaticResource TitleBarStyle}">
                    <Setter Property="Opacity" Value="1" />
                    <Style.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding ElementName=MainPanel, Path=IsMouseOver}" Value="False" />
                                <Condition Binding="{Binding ElementName=DungeonsContainer, Path=Visibility}" Value="Visible" />
                                <Condition Binding="{Binding ElementName=MainMenu, Path=IsOpen}" Value="False" />
                                <Condition Binding="{Binding Source={x:Static properties:Settings.Default}, Path=AutoHideTitleBars}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="0"
                                                             Storyboard.TargetProperty="Opacity"
                                                             Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="1"
                                                             Storyboard.TargetProperty="Opacity"
                                                             Duration="00:00:00.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
        </Border>

        <ItemsControl Name="DungeonsContainer"
                      Grid.Row="1"
                      ItemsSource="{Binding Source={StaticResource DungeonsCollection}}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <view:DungeonView DataContext="{Binding}"
                                        Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibility}}"
                                        Width="{Binding ElementName=DungeonsContainer, Path=ActualWidth}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.Style>
                <Style TargetType="ItemsControl" BasedOn="{StaticResource VirtualizingItemsControlStyle}">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ItemsControl.Style>
        </ItemsControl>

        <Grid Name="ResizeHeight" Grid.Row="2">
            <Rectangle VerticalAlignment="Bottom"
                       HorizontalAlignment="Stretch"
                       Height="1" Fill="{StaticResource TitleBarBorderBrush}" />
            <Grid.Style>
                <Style TargetType="Grid">
                    <Setter Property="Opacity" Value="1" /><commit_msg>Fixed issue with the dungeon tracker where the first and last dungeons would disappear after expanding the window from the collapsed state.<commit_after>﻿<src:OverlayWindow x:Class="GW2PAO.Modules.Dungeons.Views.DungeonTrackerView"
        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:src="clr-namespace:GW2PAO.Views"
        xmlns:view="clr-namespace:GW2PAO.Modules.Dungeons.Views"
        xmlns:converters="clr-namespace:GW2PAO.Converters"
        xmlns:properties="clr-namespace:GW2PAO.Properties"
        xmlns:resx="clr-namespace:GW2PAO.Properties"
        xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        d:DesignHeight="200"
        Top="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerY}"
        Left="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerX}"
        MinWidth="150" MaxWidth="350" Width="{Binding Source={x:Static properties:Settings.Default}, Path=DungeonTrackerWidth}"
        WindowStyle="None" AllowsTransparency="true" Background="Transparent"
        ResizeMode="CanResizeWithGrip"
        Topmost="True"
        Closed="Window_Closed"
        UseLayoutRounding="True"
        SnapsToDevicePixels="True"
        TextOptions.TextFormattingMode="Display">
    
    <src:OverlayWindow.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
        <core:AutoRefreshCollectionViewSource Source="{Binding Dungeons}" x:Key="DungeonsCollection" />
    </src:OverlayWindow.Resources>

    <Grid Name="MainPanel">

        <Grid.Background>
            <SolidColorBrush Color="#01000000" />
        </Grid.Background>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Border Name="TitleBar"
                MouseLeftButtonDown="TitleBar_MouseLeftButtonDown"
                MouseLeftButtonUp="TitleBar_MouseLeftButtonUp"
                Grid.Row="0">
            <Grid Margin="5,0,0,0">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Image Name="TitleImage"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Height="30" Width="30"
                        Margin="0,0,0,0"
                        Source="/Images/Title/dungeons.png"
                        MouseDown="TitleImage_MouseDown">
                    <Image.ContextMenu>
                        <ContextMenu Name="MainMenu">
                            <MenuItem Header="{x:Static resx:Resources.ResetHiddenDungeons}" Command="{Binding ResetHiddenDungeonsCommand}" />
                            <MenuItem Header="{x:Static resx:Resources.ResetCompletedPaths}" Command="{Binding ResetCompletedPathsCommand}" />
                            <Separator />
                            <MenuItem Header="{x:Static resx:Resources.Close}" Click="CloseWindowButton_Click" />
                        </ContextMenu>
                    </Image.ContextMenu>
                    <Image.Style>
                        <Style TargetType="{x:Type Image}">
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect ShadowDepth="0"
                                                Color="LightGreen"
                                                Opacity="0"
                                                BlurRadius="7"/>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Trigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation To="1"
                                                            Storyboard.TargetProperty="(Effect).Opacity"
                                                            Duration="00:00:00.1"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation To="0"
                                                            Storyboard.TargetProperty="(Effect).Opacity"
                                                            Duration="00:00:0.1"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.ExitActions>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Image.Style>
                </Image>

                <core:OutlinedTextBlock Grid.Column="1" Margin="5,0,0,0"
                                        VerticalAlignment="Center"
                                        Fill="PaleGoldenrod" FontFamily="Candara" FontSize="17"
                                        Text="{x:Static resx:Resources.Dungeons}" />

                <Button Name="CollapseExpandButton"
                        Grid.Column="2"
                        Margin="3"
                        Click="CollapseExpandButton_Click">
                    <Button.Style>
                        <Style TargetType="Button" BasedOn="{StaticResource TitleBarButtonStyle}">
                            <Setter Property="Content" Value="{StaticResource CollapseGraphic}" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Visibility, ElementName=DungeonsContainer}" Value="Collapsed">
                                    <DataTrigger.Setters>
                                        <Setter Property="Content" Value="{StaticResource ExpandGraphic}" />
                                    </DataTrigger.Setters>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Button.Style>
                </Button>

                <Button Name="CloseWindowButton"
                        Grid.Column="3"
                        Margin="3,3,5,3"
                        Style="{StaticResource TitleBarButtonStyle}"
                        Content="{StaticResource CloseGraphic}"
                        Click="CloseWindowButton_Click" />
            </Grid>
            <Border.Style>
                <Style TargetType="Border" BasedOn="{StaticResource TitleBarStyle}">
                    <Setter Property="Opacity" Value="1" />
                    <Style.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding ElementName=MainPanel, Path=IsMouseOver}" Value="False" />
                                <Condition Binding="{Binding ElementName=DungeonsContainer, Path=Visibility}" Value="Visible" />
                                <Condition Binding="{Binding ElementName=MainMenu, Path=IsOpen}" Value="False" />
                                <Condition Binding="{Binding Source={x:Static properties:Settings.Default}, Path=AutoHideTitleBars}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="0"
                                                             Storyboard.TargetProperty="Opacity"
                                                             Duration="00:00:0.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="1"
                                                             Storyboard.TargetProperty="Opacity"
                                                             Duration="00:00:00.2"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
        </Border>

        <ItemsControl Name="DungeonsContainer"
                      Grid.Row="1"
                      ItemsSource="{Binding Source={StaticResource DungeonsCollection}}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <view:DungeonView DataContext="{Binding}"
                                        Visibility="{Binding IsVisible, Converter={StaticResource BoolToVisibility}}"
                                        Width="{Binding ElementName=DungeonsContainer, Path=ActualWidth}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.Style>
                <Style TargetType="ItemsControl">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ItemsControl.Style>
        </ItemsControl>

        <Grid Name="ResizeHeight" Grid.Row="2">
            <Rectangle VerticalAlignment="Bottom"
                       HorizontalAlignment="Stretch"
                       Height="1" Fill="{StaticResource TitleBarBorderBrush}" />
            <Grid.Style>
                <Style TargetType="Grid">
                    <Setter Property="Opacity" Value="1" />
{'fraction_non_alphanumeric': 0.09552561618528364, 'fraction_numerical': 0.009822917136033884, 'mean_word_length': 1.170986990120317, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 0, '>': 263, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 114, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2886547', 'n_tokens_mistral': 4971, 'n_tokens_neox': 4494, 'n_words': 647}