Files

88 lines
8.2 KiB
XML
Raw Permalink Normal View History

<local:MyCard x:Class="PCL.ServerCard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PCL;assembly="
xmlns:controls="clr-namespace:PCL.Core.UI.Controls;assembly=PCL.Core"
Margin="0,8">
<Grid
x:Name="PanBack" Height="44"
RenderTransformOrigin="0.5,0.5" Background="{StaticResource ColorBrushSemiTransparent}"
SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6" />
<ColumnDefinition Width="34" />
<ColumnDefinition Width="7" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="350" />
<ColumnDefinition Width="60" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="17" />
<RowDefinition Height="18" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<!-- Icon -->
<Border Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" IsHitTestVisible="False" SnapsToDevicePixels="True"
UseLayoutRounding="True"
HorizontalAlignment="Right" VerticalAlignment="Center" Width="34" Height="34">
<Border.Clip>
<RectangleGeometry Rect="0,0,34,34" RadiusX="6" RadiusY="6" />
</Border.Clip>
<Image x:Name="ServerIcon" RenderOptions.BitmapScalingMode="HighQuality" />
</Border>
<!-- 标题 -->
<TextBlock Grid.Column="3" Grid.Row="1" VerticalAlignment="Bottom" x:Name="ServerName"
TextTrimming="CharacterEllipsis" FontSize="14"
HorizontalAlignment="Left" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
ToolTipService.Placement="Top" MaxWidth="180" />
<!-- ping 值与玩家人数 -->
<StackPanel Grid.Row="2" Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Bottom">
<ContentPresenter x:Name="Signal" Content="{Binding SelectedIcon.XamlContent}"
Width="20" Height="20" />
<TextBlock x:Name="ServerPlayer" HorizontalAlignment="Left"
TextTrimming="CharacterEllipsis" FontSize="12"
Foreground="{DynamicResource ColorBrushGray3}" Opacity="0.4" VerticalAlignment="Center" />
</StackPanel>
<!-- MotD -->
<controls:MotdRenderer x:Name="MotdRenderer" Grid.Row="1" Grid.RowSpan="2" Grid.Column="4" Margin="0,0,3,1"
IsHitTestVisible="False" HorizontalAlignment="Center" Width="350" Height="34" />
<TextBlock Grid.Row="1" x:Name="ServerMotD" Grid.RowSpan="2" Grid.Column="4" VerticalAlignment="Center"
Margin="0,0,3,1"
TextTrimming="CharacterEllipsis" FontSize="12" Foreground="{DynamicResource ColorBrushGray4}"
IsHitTestVisible="False" HorizontalAlignment="Center" Visibility="Visible" />
<!--<Canvas x:Name="MotdCanvas" Grid.Row="1" Grid.RowSpan="2" Grid.Column="4" Margin="0,0,3,1"
IsHitTestVisible="False" HorizontalAlignment="Center" Width="300" Height="34"/>-->
<StackPanel Grid.Row="1" Grid.Column="5" Grid.RowSpan="2" Orientation="Horizontal" VerticalAlignment="Center"
Margin="0,0,4,0">
<local:MyIconButton
Width="24"
SvgIcon="lucide/play"
Click="BtnConnect_Click" />
<local:MyIconButton
x:Name="BtnSetting"
Click="BtnSkin_Click"
Width="24"
LogoScale="1.2"
SvgIcon="lucide/settings">
<local:MyIconButton.ContextMenu>
<ContextMenu>
<local:MyMenuItem Click="BtnRefresh_Click" Header="{DynamicResource Common.Action.Refresh}"
Icon="M849.493333 661.76h-193.28a42.666667 42.666667 0 0 0 0 85.333333h102.4A341.333333 341.333333 0 0 1 170.666667 512a42.666667 42.666667 0 0 0-85.333334 0 426.666667 426.666667 0 0 0 720.213334 308.48V896a42.666667 42.666667 0 0 0 85.333333 0v-192a42.666667 42.666667 0 0 0-41.386667-42.24zM640 512a128 128 0 1 0-128 128 128 128 0 0 0 128-128z m-170.666667 0a42.666667 42.666667 0 1 1 42.666667 42.666667 42.666667 42.666667 0 0 1-42.666667-42.666667z m42.666667-426.666667a426.666667 426.666667 0 0 0-293.546667 118.186667V128a42.666667 42.666667 0 0 0-85.333333 0v192a42.666667 42.666667 0 0 0 42.666667 42.666667h192a42.666667 42.666667 0 0 0 0-85.333334h-102.4A341.333333 341.333333 0 0 1 853.333333 512a42.666667 42.666667 0 0 0 85.333334 0A426.666667 426.666667 0 0 0 512 85.333333z" />
<local:MyMenuItem Click="BtnCopy_Click"
Header="{DynamicResource Instance.Server.Card.CopyAddress}"
Icon="M931.882 131.882l-103.764-103.764A96 96 0 0 0 760.236 0H416c-53.02 0-96 42.98-96 96v96H160c-53.02 0-96 42.98-96 96v640c0 53.02 42.98 96 96 96h448c53.02 0 96-42.98 96-96v-96h160c53.02 0 96-42.98 96-96V199.764a96 96 0 0 0-28.118-67.882zM596 928H172a12 12 0 0 1-12-12V300a12 12 0 0 1 12-12h148v448c0 53.02 42.98 96 96 96h192v84a12 12 0 0 1-12 12z m256-192H428a12 12 0 0 1-12-12V108a12 12 0 0 1 12-12h212v176c0 26.51 21.49 48 48 48h176v404a12 12 0 0 1-12 12z m12-512h-128V96h19.264c3.182 0 6.234 1.264 8.486 3.514l96.736 96.736a12 12 0 0 1 3.514 8.486V224z" />
<local:MyMenuItem Click="BtnEdit_Click" Header="{DynamicResource Instance.Server.Card.Edit}"
Icon="M934.4 981.333333H89.6A46.08 46.08 0 0 1 42.666667 934.485333V156.672a46.08 46.08 0 0 1 46.933333-46.848h367.658667c26.581333 0 46.933333 20.309333 46.933333 46.848a46.08 46.08 0 0 1-46.933333 46.848H136.533333v684.117333h750.933334v-371.712a46.08 46.08 0 0 1 46.933333-46.890666c26.581333 0 46.933333 20.309333 46.933333 46.848v418.56c0 26.581333-21.888 46.890667-46.933333 46.890666z M330.538667 739.242667c-12.544 0-25.045333-4.693333-32.853334-14.08-9.386667-9.344-14.08-20.266667-14.08-32.768v-187.434667c0-12.501333 4.693333-24.96 14.08-32.768l416.128-415.488c7.808-9.386667 20.352-14.037333 32.853334-14.037333 12.501333 0 25.045333 4.693333 32.853333 14.08l187.733333 187.392c18.773333 18.773333 18.773333 48.426667 0 65.621333l-416.128 415.445333c-9.386667 9.386667-20.352 14.08-32.853333 14.08h-187.733333z m46.933333-215.552v120.32h120.448l369.194667-367.061334L746.666667 155.136l-369.194667 368.597333z" />
<Separator />
<local:MyMenuItem Click="BtnRemove_Click"
Header="{DynamicResource Instance.Server.Card.Remove}"
Icon="M683.514192 1023.999519H340.485808A154.527713 154.527713 0 0 1 186.336081 884.785983L129.317406 325.755552a39.082648 39.082648 0 0 1 77.762111-7.937715l57.053038 559.030431a76.559427 76.559427 0 0 0 76.376161 68.976791h343.005476a76.559427 76.559427 0 0 0 76.376161-68.976791l57.053038-559.030431a39.082648 39.082648 0 1 1 77.762112 7.937715l-57.053039 559.030431A154.516259 154.516259 0 0 1 683.514192 1023.999519zM888.85244 191.513109h-753.681972a39.092957 39.092957 0 0 1 0-78.17446h753.681972a39.092957 39.092957 0 0 1 0 78.17446z M409.199153 704.887365a39.092957 39.092957 0 0 1-39.081502-39.081503V451.991555a39.092957 39.092957 0 0 1 78.174459 0v213.814307a39.092957 39.092957 0 0 1-39.092957 39.081503zM614.789392 704.887365a39.092957 39.092957 0 0 1-39.081502-39.081503V451.991555a39.092957 39.092957 0 0 1 78.174459 0v213.814307a39.092957 39.092957 0 0 1-39.092957 39.081503zM667.844938 171.960904a39.081503 39.081503 0 0 1-39.127319-39.081503 54.773666 54.773666 0 0 0-54.716395-54.716395h-124.048264a54.773666 54.773666 0 0 0-54.716395 54.716395 39.081503 39.081503 0 1 1-78.163006 0 133.028304 133.028304 0 0 1 132.867947-132.867947H574.04704a133.028304 133.028304 0 0 1 132.867947 132.867947 39.070049 39.070049 0 0 1-39.070049 39.081503z" />
</ContextMenu>
</local:MyIconButton.ContextMenu>
</local:MyIconButton>
</StackPanel>
</Grid>
</local:MyCard>