<UserControl x:Class="SyncTrayzor.Pages.ViewerView"
             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:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="https://github.com/canton7/Stylet"
             xmlns:l="clr-namespace:SyncTrayzor.Localization"
             xmlns:xaml="clr-namespace:SyncTrayzor.Xaml"
             xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <ContentControl Content="{Binding WebBrowser}">
            <ContentControl.Resources>
                <Style TargetType="cefSharp:ChromiumWebBrowser">
                    <Setter Property="ContextMenu">
                        <Setter.Value>
                            <ContextMenu>
                                <MenuItem Header="{l:Loc Generic_Cut}" Command="{Binding WebBrowser.CutCommand}"/>
                                <MenuItem Header="{l:Loc Generic_Copy}" Command="{Binding WebBrowser.CopyCommand}"/>
                                <MenuItem Header="{l:Loc Generic_Paste}" Command="{Binding WebBrowser.PasteCommand}"/>
                            </ContextMenu>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ContentControl.Resources>
        </ContentControl>

        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{l:Loc ViewerView_SyncthingStarting}"
                   Visibility="{Binding ShowSyncthingStarting, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"
                   FontSize="16"/>

        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
                   Visibility="{Binding ShowSyncthingStopped, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
            <TextBlock FontSize="16" HorizontalAlignment="Center" Text="{l:Loc ViewerView_SyncthingStopped}"/>
            <TextBlock Margin="0,10,0,0" HorizontalAlignment="Center" >
                <Hyperlink Command="{s:Action Start}">
                   <TextBlock FontSize="16" Text="{l:Loc ViewerView_StartSyncthing}" />
                </Hyperlink>
            </TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
