<UserControl
    xmlns="https://github.com/avaloniaui">
    
    <Grid ColumnDefinitions="auto,auto,*,auto,auto">
        
        <CheckBox
            IsVisible="{Binding !IsSaved}"
            IsEnabled="False"
            IsChecked="False"
            Grid.Column="0" />
        
        <CheckBox
            IsVisible="{Binding IsSaved}"
            IsChecked="{Binding IsEnabled, Mode=OneWay}"
            Command="{Binding EnableCommand}"
            CommandParameter="{Binding}"
            Grid.Column="0" />
        
        <TextBlock
            Text="{Binding Server}"
            Grid.Column="1" />
        
        <TextBlock
            Text="{Binding Label}"
            Grid.Column="1" />
        
        <TextBlock
            IsVisible="{Binding !IsSaved}"
            Text=" * "
            Grid.Column="2" />
        
        <TextBlock
            Text="{Binding Port}"
            Grid.Column="3" />
        
        <Button
            Grid.Column="4"
            IsVisible="{Binding IsRemovable}"
            Command="{Binding RemoveCommand}"
            CommandParameter="{Binding}">
            <Image
                Source="resm:Tel.Egram.Application.Icons.Dark.Trash32.png?assembly=Tel.Egram.Application" />
        </Button>
        
    </Grid>
    
    <UserControl.Styles>
        
        <Style Selector="CheckBox">
            <Setter Property="Margin" Value="2,0,6,0" />
        </Style>
        
        <Style Selector="TextBlock">
            <Setter Property="Margin" Value="0" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        
        <Style Selector="RadioButton">
            <Setter Property="Margin" Value="2,0,6,0" />
        </Style>
        
        <Style Selector="Button">
            <Setter Property="Padding" Value="6,0,6,0" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Background" Value="Transparent" />
        </Style>
        
        <Style Selector="Button Image">
            <Setter Property="Width" Value="16" />
            <Setter Property="Height" Value="16" />
            <Setter Property="Opacity" Value="0.75" />
        </Style>
        
    </UserControl.Styles>
    
</UserControl>