<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup
    x:Class="SeriesTracker.Controls.CustomPopUp.ActivePagePopUp"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
    x:Name="this"
    Color="Transparent">
    <StackLayout>
        <Border
            x:Name="myBorder"
            Margin="15,25,15,25"
            Padding="10"
            BackgroundColor="{AppThemeBinding Light={StaticResource LightPopUpBackground},
                                              Dark={StaticResource DarkPopUpBackground}}"
            MinimumWidthRequest="350"
            Stroke="Transparent">
            <Grid VerticalOptions="EndAndExpand">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="45" />
                    <RowDefinition Height="45" />
                    <RowDefinition Height="1" />
                    <RowDefinition Height="45" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Label
                    x:Name="TitleLabel"
                    Grid.Row="0"
                    Grid.ColumnSpan="2"
                    Margin="10"
                    FontAttributes="Bold"
                    FontSize="18"
                    HorizontalOptions="StartAndExpand"
                    Text="{Binding Source={x:Reference this}, Path=Title}"
                    TextColor="{AppThemeBinding Light={StaticResource Primary},
                                                Dark={StaticResource PrimaryDark}}" />
                <Image
                    Grid.Row="1"
                    Grid.Column="0"
                    HeightRequest="22"
                    HorizontalOptions="Center"
                    Source="vision.png"
                    WidthRequest="22">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray300}}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    x:Name="DetachButton"
                    Grid.Row="1"
                    Grid.Column="1"
                    BackgroundColor="Transparent"
                    FontSize="15"
                    HorizontalOptions="FillAndExpand"
                    HorizontalTextAlignment="Start"
                    Text="{Binding Source={x:Reference this}, Path=DetachText}"
                    TextColor="{AppThemeBinding Light={StaticResource Gray950},
                                                Dark={StaticResource Gray200}}"
                    VerticalTextAlignment="Center">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="DetachButton_Clicked" />
                    </Label.GestureRecognizers>
                </Label>
                <Image
                    Grid.Row="2"
                    Grid.Column="0"
                    HeightRequest="22"
                    HorizontalOptions="Center"
                    Source="edit.png"
                    WidthRequest="22">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray300}}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    x:Name="EditButton"
                    Grid.Row="2"
                    Grid.Column="1"
                    BackgroundColor="Transparent"
                    FontSize="15"
                    HorizontalOptions="FillAndExpand"
                    HorizontalTextAlignment="Start"
                    Text="Изменить"
                    TextColor="{AppThemeBinding Light={StaticResource Gray950},
                                                Dark={StaticResource Gray200}}"
                    VerticalTextAlignment="Center">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="EditButton_Clicked" />
                    </Label.GestureRecognizers>
                </Label>
                <Line
                    Grid.Row="3"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    BackgroundColor="{StaticResource Gray600}" />
                <Image
                    Grid.Row="4"
                    Grid.Column="0"
                    HeightRequest="22"
                    HorizontalOptions="Center"
                    Source="delete.png"
                    WidthRequest="22">
                    <Image.Behaviors>
                        <toolkit:IconTintColorBehavior TintColor="{StaticResource Red}" />
                    </Image.Behaviors>
                </Image>
                <Label
                    x:Name="DeleteButton"
                    Grid.Row="4"
                    Grid.Column="1"
                    BackgroundColor="Transparent"
                    FontSize="15"
                    HorizontalOptions="FillAndExpand"
                    HorizontalTextAlignment="Start"
                    Text="Удалить"
                    TextColor="{StaticResource Red}"
                    VerticalTextAlignment="Center">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="DeleteButton_Clicked" />
                    </Label.GestureRecognizers>
                </Label>

            </Grid>
            <Border.StrokeShape>
                <RoundRectangle CornerRadius="10" />
            </Border.StrokeShape>
        </Border>
    </StackLayout>
</toolkit:Popup>

