<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="using:ModernKeePass.ViewModels"
    xmlns:converters="using:ModernKeePass.Converters"
    xmlns:interactivity="using:Microsoft.Xaml.Interactivity" 
    xmlns:core="using:Microsoft.Xaml.Interactions.Core"
    xmlns:actions="using:ModernKeePass.Actions"
    xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
    x:Name="PageRoot"
    x:Class="ModernKeePass.Views.GroupDetailPage"
    mc:Ignorable="d"
    SizeChanged="GroupDetailPage_OnSizeChanged">
    <Page.Resources>
        <converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
        <converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/>
    </Page.Resources>
    <Page.DataContext>
        <viewModels:GroupVm />
    </Page.DataContext>
    <Page.BottomAppBar>
        <CommandBar x:Name="CommandBar" VerticalAlignment="Center">
            <CommandBar.SecondaryCommands>
                <AppBarButton Icon="Home" x:Uid="AppBarHome">
                    <interactivity:Interaction.Behaviors>
                        <core:EventTriggerBehavior EventName="Click">
                            <core:NavigateToPageAction TargetPage="ModernKeePass.Views.MainPage" />
                        </core:EventTriggerBehavior>
                    </interactivity:Interaction.Behaviors>
                </AppBarButton>
                <AppBarButton Icon="Save" x:Uid="AppBarSave">
                    <interactivity:Interaction.Behaviors>
                        <core:EventTriggerBehavior EventName="Click">
                            <core:CallMethodAction TargetObject="{Binding}" MethodName="Save"/>
                            <core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
                        </core:EventTriggerBehavior>
                    </interactivity:Interaction.Behaviors>
                </AppBarButton>
                <AppBarButton Icon="Setting" x:Uid="AppBarSettings">
                    <interactivity:Interaction.Behaviors>
                        <core:EventTriggerBehavior EventName="Click">
                            <core:NavigateToPageAction TargetPage="ModernKeePass.Views.SettingsPage" />
                        </core:EventTriggerBehavior>
                    </interactivity:Interaction.Behaviors>
                </AppBarButton>
            </CommandBar.SecondaryCommands>
            <AppBarButton Icon="Sort" x:Uid="AppBarSort" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}">
                <Button.Flyout>
                    <MenuFlyout>
                        <MenuFlyoutItem x:Uid="AppBarSortEntries">
                            <interactivity:Interaction.Behaviors>
                                <core:EventTriggerBehavior EventName="Click">
                                    <core:CallMethodAction MethodName="SortEntries" TargetObject="{Binding}" />
                                </core:EventTriggerBehavior>
                            </interactivity:Interaction.Behaviors>
                        </MenuFlyoutItem>
                        <MenuFlyoutItem x:Uid="AppBarSortGroups">
                            <interactivity:Interaction.Behaviors>
                                <core:EventTriggerBehavior EventName="Click">
                                    <core:CallMethodAction MethodName="SortGroups" TargetObject="{Binding}" />
                                </core:EventTriggerBehavior>
                            </interactivity:Interaction.Behaviors>
                        </MenuFlyoutItem>
                    </MenuFlyout>
                </Button.Flyout>
            </AppBarButton>
            <AppBarToggleButton Icon="Edit" x:Uid="AppBarEdit" IsChecked="{Binding IsEditMode, Mode=TwoWay}">
                <interactivity:Interaction.Behaviors>
                    <core:EventTriggerBehavior EventName="Click">
                        <core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
                    </core:EventTriggerBehavior>
                </interactivity:Interaction.Behaviors>
            </AppBarToggleButton>
            <AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click">
                <interactivity:Interaction.Behaviors>
                    <core:EventTriggerBehavior EventName="Click">
                        <core:CallMethodAction MethodName="UndoDelete" TargetObject="{Binding}" />
                    </core:EventTriggerBehavior>
                </interactivity:Interaction.Behaviors>
            </AppBarButton>
            <AppBarButton Icon="Delete" x:Uid="AppBarDelete" IsEnabled="{Binding IsNotRoot}" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Click="DeleteButton_Click" />
        </CommandBar>
    </Page.BottomAppBar>
    <Grid>
        <Grid.Resources>
            <CollectionViewSource
                x:Name="GroupsViewSource"
                Source="{Binding Groups}" />
            <CollectionViewSource
                x:Name="EntriesViewSource"
                Source="{Binding Entries}" />
            <CollectionViewSource
                x:Name="EntriesZoomedOutViewSource"
                Source="{Binding EntriesZoomedOut}" IsSourceGrouped="True"/>
        </Grid.Resources>
        <Grid.Background>
            <StaticResource ResourceKey="ApplicationPageBackgroundThemeBrush"/>
        </Grid.Background>
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <ListView 
                Grid.Column="0"
                x:Name="LeftListView"
                SelectionChanged="groups_SelectionChanged"
                IsSwipeEnabled="false"
                IsSynchronizedWithCurrentItem="False"
                DataContext="{Binding DataContext, ElementName=PageRoot}" 
                RequestedTheme="Dark"
                Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                Foreground="{ThemeResource DefaultTextForegroundThemeBrush}">
                <ListView.Resources>
                    <DataTemplate x:Name="IsRecycleBin">
                        <StackPanel Orientation="Horizontal">
                            <SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
                                <ToolTipService.ToolTip>
                                    <ToolTip Content="{Binding Name}" />
                                </ToolTipService.ToolTip>
                             </SymbolIcon>
                            <TextBlock Text="{Binding Name}" x:Name="GroupTextBlock" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" FontStyle="Italic" />
                        </StackPanel>
                    </DataTemplate>
                    <DataTemplate x:Name="IsNotRecycleBin">
                        <StackPanel Orientation="Horizontal">
                            <SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
                                <ToolTipService.ToolTip>
                                    <ToolTip Content="{Binding Name}" />
                                </ToolTipService.ToolTip>
                             </SymbolIcon>
                            <TextBlock Text="{Binding Name}" x:Name="GroupTextBlock" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" />
                        </StackPanel>
                    </DataTemplate>
                </ListView.Resources>
                <ListView.ItemTemplateSelector>
                    <templateSelectors:SelectableDataTemplateSelector FalseItem="{StaticResource IsNotRecycleBin}" TrueItem="{StaticResource IsRecycleBin}" />
                </ListView.ItemTemplateSelector>
                <ListView.ItemsSource>
                    <Binding Source="{StaticResource GroupsViewSource}"/>
                </ListView.ItemsSource>
                <ListView.ItemContainerStyle>
                    <Style TargetType="ListViewItem">
                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
                        <Setter Property="Padding" Value="0"/>
                        <Setter Property="Margin" Value="0"/>
                        <Setter Property="AllowDrop" Value="True"/>
                    </Style>
                </ListView.ItemContainerStyle>
                <ListView.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <ToggleButton Style="{StaticResource HamburgerToggleButton}">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Uid="GroupsHeaderToolTip" />
                                </ToolTipService.ToolTip>
                                <interactivity:Interaction.Behaviors>
                                    <core:EventTriggerBehavior EventName="Checked">
                                        <core:ChangePropertyAction PropertyName="Width" Value="Auto" TargetObject="{Binding ElementName=LeftListViewColumn}"/>
                                    </core:EventTriggerBehavior>
                                    <core:EventTriggerBehavior EventName="Unchecked">
                                        <core:ChangePropertyAction PropertyName="Width" Value="50" TargetObject="{Binding ElementName=LeftListViewColumn}"/>
                                    </core:EventTriggerBehavior>
                                </interactivity:Interaction.Behaviors>
                            </ToggleButton>
                            <TextBlock x:Uid="GroupsHeaderTextBlock" FontWeight="Bold" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0"  />
                        </StackPanel>
                    </DataTemplate>
                </ListView.HeaderTemplate>
                <ListView.FooterTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
                            <Border BorderBrush="White" BorderThickness="0,0,0,1" />
                            <Button Padding="0" Height="50" Margin="0" Style="{StaticResource NoBorderButtonStyle}" Background="Transparent" BorderThickness="0" Click="CreateGroup_ButtonClick">
                                <StackPanel Orientation="Horizontal" Margin="13,0,5,0">
                                    <SymbolIcon Symbol="Add">
                                        <ToolTipService.ToolTip>
                                            <ToolTip x:Uid="GroupNewItemTooltip" />
                                        </ToolTipService.ToolTip>
                                    </SymbolIcon>
                                    <TextBlock x:Uid="GroupNewItemTextBox" FontWeight="SemiBold" TextWrapping="NoWrap" FontSize="16" VerticalAlignment="Center" Margin="30,0,20,0" />
                                </StackPanel>
                            </Button>
                        </StackPanel>
                    </DataTemplate>
                </ListView.FooterTemplate>
            </ListView>
            <TextBlock Grid.Column="1" x:Uid="ReorderEntriesLabel" Margin="20,20,0,0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource BodyTextBlockStyle}" />
            <HyperlinkButton Grid.Column="1" VerticalAlignment="Top" Margin="40,10,0,0" Click="CreateEntry_ButtonClick" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}">
                <StackPanel Orientation="Horizontal">
                    <SymbolIcon Symbol="Add"></SymbolIcon>
                    <TextBlock x:Uid="GroupCreateEntry" VerticalAlignment="Center" Margin="10,0,0,0" />
                </StackPanel>
            </HyperlinkButton>
            <SemanticZoom Grid.Column="1" ViewChangeStarted="SemanticZoom_ViewChangeStarted" Margin="20,60,0,0" ScrollViewer.HorizontalScrollBarVisibility="Visible">
                <SemanticZoom.ZoomedInView>
                    <!-- Horizontal scrolling grid -->
                    <GridView
                        x:Name="GridView"
                        AutomationProperties.AutomationId="ItemGridView"
                        AutomationProperties.Name="Entries"
                        TabIndex="1"
                        SelectionChanged="entries_SelectionChanged"
                        IsSynchronizedWithCurrentItem="False" 
                        BorderBrush="{StaticResource ListViewItemSelectedBackgroundThemeBrush}"
                        AllowDrop="True"
                        CanReorderItems="True" 
                        CanDragItems="True"
                        DragItemsStarting="GridView_DragItemsStarting">
                        <interactivity:Interaction.Behaviors>
                            <core:DataTriggerBehavior Binding="{Binding IsEditMode}" Value="False">
                                <actions:SetupFocusAction TargetObject="{Binding ElementName=GridView}" />
                            </core:DataTriggerBehavior>
                        </interactivity:Interaction.Behaviors>
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="110" Width="480" x:Name="EntryGrid">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Background="{Binding BackgroundColor, ConverterParameter={StaticResource MainColor}, Converter={StaticResource ColorToBrushConverter}}">
                                        <Viewbox MaxHeight="50" Width="100">
                                            <SymbolIcon Symbol="{Binding IconSymbol}" Foreground="{StaticResource TextColor}" />
                                        </Viewbox>
                                    </Border>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,10,0,0" >
                                        <TextBlock x:Name="NameTextBlock" Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}"/>
                                        <TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
                                        <TextBlock Text="{Binding UserName}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
                                        <TextBlock Text="{Binding Url}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
                                    </StackPanel>
                                    <Button Grid.Column="2" Style="{StaticResource NoBorderButtonStyle}" Background="{Binding BackgroundColor, ConverterParameter={StaticResource AppBarBackgroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}" VerticalAlignment="Bottom">
                                        <SymbolIcon Symbol="More" />
                                        <Button.Flyout>
                                            <MenuFlyout>
                                                <MenuFlyoutItem x:Uid="EntryItemCopyLogin">
                                                    <interactivity:Interaction.Behaviors>
                                                        <core:EventTriggerBehavior EventName="Click">
                                                            <actions:ClipboardAction Text="{Binding UserName}" />
                                                        </core:EventTriggerBehavior>
                                                    </interactivity:Interaction.Behaviors>
                                                </MenuFlyoutItem>
                                                <MenuFlyoutItem x:Uid="EntryItemCopyPassword">
                                                    <interactivity:Interaction.Behaviors>
                                                        <core:EventTriggerBehavior EventName="Click">
                                                            <actions:ClipboardAction Text="{Binding Password}" />
                                                        </core:EventTriggerBehavior>
                                                    </interactivity:Interaction.Behaviors>
                                                </MenuFlyoutItem>
                                                <MenuFlyoutItem x:Uid="EntryItemCopyUrl">
                                                    <interactivity:Interaction.Behaviors>
                                                        <core:EventTriggerBehavior EventName="Click">
                                                            <actions:NavigateToUrlAction Url="{Binding Url}" />
                                                        </core:EventTriggerBehavior>
                                                    </interactivity:Interaction.Behaviors>
                                                </MenuFlyoutItem>
                                            </MenuFlyout>
                                        </Button.Flyout>
                                    </Button>
                                </Grid>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                        <GridView.ItemsSource>
                            <Binding Source="{StaticResource EntriesViewSource}"/>
                        </GridView.ItemsSource>
                        <GridView.DataContext>
                            <viewModels:EntryVm/>
                        </GridView.DataContext>
                    </GridView>
                </SemanticZoom.ZoomedInView>
                <SemanticZoom.ZoomedOutView>
                    <GridView
                        ItemsSource="{Binding Source={StaticResource EntriesZoomedOutViewSource}}"
                        SelectionChanged="groups_SelectionChanged"
                        SelectionMode="None"
                        IsSynchronizedWithCurrentItem="False">
                        <GridView.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock Width="100" Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
                                </StackPanel>
                            </DataTemplate>
                        </GridView.ItemTemplate>
                        <GridView.GroupStyle>
                            <GroupStyle HidesIfEmpty="True">
                                <GroupStyle.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid Background="LightGray" HorizontalAlignment="Left">
                                            <TextBlock Text="{Binding Key}" Width="40" Margin="30" Foreground="Black" Style="{StaticResource HeaderTextBlockStyle}" TextAlignment="Center" />
                                        </Grid>
                                    </DataTemplate>
                                </GroupStyle.HeaderTemplate>
                            </GroupStyle>
                        </GridView.GroupStyle>
                    </GridView>
                </SemanticZoom.ZoomedOutView>
            </SemanticZoom>
        </Grid>
        <!-- Back button and page title -->
        <Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Button Grid.Column="0" 
                    Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
                    Height="50"
                    Width="50"
                    AutomationProperties.Name="Back"
                    AutomationProperties.AutomationId="BackButton"
                    AutomationProperties.ItemType="Navigation Button"
                    Style="{StaticResource NoBorderButtonStyle}">
                <SymbolIcon Symbol="Back" />
            </Button>
            <StackPanel Grid.Column="1" >
                <TextBox
                    x:Name="TitleTextBox"
                    Text="{Binding Name, Mode=TwoWay}" 
                    Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"
                    Background="Transparent"
                    IsHitTestVisible="{Binding IsEditMode}" 
                    BorderThickness="0" 
                    FontSize="20"
                    FontWeight="SemiBold"
                    TextWrapping="NoWrap" 
                    VerticalAlignment="Center" 
                    x:Uid="GroupTitle">
                    <interactivity:Interaction.Behaviors>
                        <core:DataTriggerBehavior Binding="{Binding IsEditMode}" Value="True">
                            <actions:SetupFocusAction TargetObject="{Binding ElementName=TitleTextBox}" />
                        </core:DataTriggerBehavior>
                    </interactivity:Interaction.Behaviors>
                </TextBox>
                <TextBlock FontSize="12" Text="{Binding Path}" />
            </StackPanel>
            <Button Grid.Column="2" x:Name="SearchButton" Style="{StaticResource NoBorderButtonStyle}" Height="50">
                <SymbolIcon Symbol="Find" />
                <Button.Flyout>
                    <Flyout>
                        <Flyout.FlyoutPresenterStyle>
                            <Style TargetType="FlyoutPresenter">
                                <Setter Property="Padding" Value="0" />
                            </Style>
                        </Flyout.FlyoutPresenterStyle>
                        <!--<controls:TextBoxWithButton x:Uid="GroupFilter" ButtonSymbol="&#xE16E;" Text="{Binding Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="18" VerticalContentAlignment="Center" Width="400" Style="{StaticResource TextBoxWithButtonStyle}" IsButtonEnabled="False" />-->
                        <SearchBox x:Uid="GroupSearch" Width="350" Padding="12" Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}" BorderThickness="0" FontSize="18" SuggestionsRequested="SearchBox_OnSuggestionsRequested" SearchHistoryEnabled="False" ResultSuggestionChosen="SearchBox_OnResultSuggestionChosen" Style="{StaticResource MainColorSearchBox}" />
                    </Flyout>
                </Button.Flyout>
            </Button>
            <!--<controls:TextBoxWithButton Grid.Column="2" x:Name="FilterBox" x:Uid="GroupFilter" ButtonSymbol="&#xE16E;" Text="{Binding Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="18" VerticalContentAlignment="Center" Width="400" Style="{StaticResource TextBoxWithButtonStyle}" IsButtonEnabled="False" />-->
            <SearchBox Grid.Column="2" x:Uid="GroupSearch" x:Name="SearchBox" Padding="12" Width="350" Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}" BorderThickness="0" FontSize="18" SuggestionsRequested="SearchBox_OnSuggestionsRequested" SearchHistoryEnabled="False" ResultSuggestionChosen="SearchBox_OnResultSuggestionChosen" Style="{StaticResource MainColorSearchBox}" />
        </Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="DragDropGroup">
                <VisualState x:Name="Dragging">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GridView" Storyboard.TargetProperty="BorderThickness">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Dropped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GridView" Storyboard.TargetProperty="BorderThickness">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup x:Name="SearchGroup">
                <VisualState x:Name="Small">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBox" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Large">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBox" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>