<UserControl
    x:Class="Bili.App.Controls.App.PageHeader"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Bili.App.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:loc="using:Bili.App.Resources.Extension"
    xmlns:local="using:Bili.App.Controls.App"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    IsTabStop="False"
    mc:Ignorable="d">

    <Grid
        Margin="{x:Bind _appViewModel.PageTopPadding, Converter={StaticResource TopThicknessConverter}, Mode=OneWay}"
        Padding="{x:Bind _appViewModel.PageHorizontalPadding, Converter={StaticResource HorizontalThicknessConverter}, Mode=OneWay}"
        ColumnSpacing="12">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <ContentPresenter
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Content="{x:Bind Title, Mode=OneWay}"
            FontSize="28"
            FontWeight="SemiLight"
            TextWrapping="NoWrap" />
        <ContentPresenter
            Grid.Column="1"
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            Content="{x:Bind Element, Mode=OneWay}"
            Visibility="{x:Bind Element, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" />
        <Button
            x:Name="RefreshButton"
            Grid.Column="1"
            VerticalAlignment="Center"
            Command="{x:Bind RefreshCommand, Mode=OneWay}"
            Visibility="{x:Bind RefreshCommand, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}">
            <controls:IconTextBlock Symbol="ArrowSync16" Text="{loc:Locale Name=Refresh}" />
        </Button>

        <Image
            Grid.Column="1"
            Width="68"
            VerticalAlignment="Center"
            Source="ms-appx:///Assets/logo.svg"
            Visibility="{x:Bind IsShowLogo, Mode=OneWay}" />
    </Grid>
</UserControl>
