|
23 | 23 | <Button Content="下载资源" x:Name="DlModBtn" Margin="0,0,10,0" hc:IconElement.Geometry="{StaticResource DownloadGeometry}" Click="DlModBtn_Click"/> |
24 | 24 | <Button Content="下载服务端" x:Name="DlServerCoreBtn" hc:IconElement.Geometry="{StaticResource DownloadGeometry}" Click="DlServerCoreBtn_Click"/> |
25 | 25 | </StackPanel> |
| 26 | + <controls:MagicListBox Grid.Row="1" x:Name="serverList" hc:Empty.ShowEmpty="true" MouseDoubleClick="serverList_MouseDoubleClick" SelectionMode="Single" SelectionChanged="serverList_SelectionChanged" Background="Transparent"> |
| 27 | + <controls:MagicListBox.ItemTemplate> |
| 28 | + <DataTemplate> |
| 29 | + <Grid Width="auto" Background="Transparent"> |
| 30 | + <Grid.RowDefinitions> |
| 31 | + <RowDefinition Height="Auto"/> |
| 32 | + <RowDefinition Height="*"/> |
| 33 | + </Grid.RowDefinitions> |
| 34 | + <Label Style="{StaticResource BorderTitle}"> |
| 35 | + <TextBlock> |
| 36 | + <Run Text="#"/><Run Text="{Binding ServerID}"/> |
| 37 | + <Run Text="{Binding ServerName}"/> |
| 38 | + </TextBlock> |
| 39 | + </Label> |
| 40 | + <hc:UniformSpacingPanel Grid.Row="1" Orientation="Vertical" Spacing="10"> |
| 41 | + <hc:UniformSpacingPanel Spacing="5" Orientation="Horizontal"> |
| 42 | + <Image Height="28" Width="28" Name="imageName" Source="{Binding ServerIcon, Converter={StaticResource ImagePathConverter}}" HorizontalAlignment="Left"/> |
| 43 | + <Label Content="{Binding ServerState}"> |
| 44 | + <Label.Style> |
| 45 | + <Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}"> |
| 46 | + <Setter Property="Foreground" Value="White"/> |
| 47 | + <Setter Property="Background" Value="{DynamicResource DarkDangerBrush}"/> |
| 48 | + <Style.Triggers> |
| 49 | + <DataTrigger Binding="{Binding ServerState}" Value="运行中"> |
| 50 | + <Setter Property="Background" Value="{DynamicResource DarkSuccessBrush}"/> |
| 51 | + </DataTrigger> |
| 52 | + <DataTrigger Binding="{Binding ServerState}" Value="已开服"> |
| 53 | + <Setter Property="Background" Value="{DynamicResource DarkSuccessBrush}"/> |
| 54 | + </DataTrigger> |
| 55 | + </Style.Triggers> |
| 56 | + </Style> |
| 57 | + </Label.Style> |
| 58 | + </Label> |
| 59 | + </hc:UniformSpacingPanel> |
| 60 | + <hc:UniformSpacingPanel Spacing="5" Orientation="Horizontal"> |
| 61 | + <Button Style="{StaticResource ButtonPrimary}" Content="开启服务器" hc:IconElement.Geometry="{StaticResource CheckedGeometry}" hc:IconElement.Width="16" HorizontalAlignment="Left" Click="startServerBtn_Click"/> |
| 62 | + <Button hc:IconElement.Geometry="{StaticResource ConfigGeometry}" hc:IconElement.Height="16" HorizontalAlignment="Left" hc:Poptip.Content="服务器设置" hc:Poptip.HorizontalOffset="40" hc:Poptip.Placement="Left" Click="setServerBtn_Click"/> |
| 63 | + <Button hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" hc:IconElement.Height="16" HorizontalAlignment="Left" hc:Poptip.Content="删除该服务器" hc:Poptip.HorizontalOffset="40" hc:Poptip.Placement="Left" Click="delServerBtn_Click"/> |
| 64 | + </hc:UniformSpacingPanel> |
| 65 | + </hc:UniformSpacingPanel> |
| 66 | + </Grid> |
| 67 | + </DataTemplate> |
| 68 | + </controls:MagicListBox.ItemTemplate> |
| 69 | + <controls:MagicListBox.ContextMenu> |
| 70 | + <ContextMenu> |
| 71 | + <MenuItem Click="refreshList_Click" Header="{Binding [Page_ServerList_Refresh], Source={x:Static langs:LanguageManager.Instance}}"/> |
| 72 | + <MenuItem x:Name="startServerBtn" Click="startServer_Click" Header="{Binding [Page_ServerList_LaunchServer], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 73 | + <MenuItem x:Name="startWithCmd" Click="startWithCmd_Click" Header="{Binding [Page_ServerList_UseCMDLaunch], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 74 | + <MenuItem x:Name="setServer" Click="setServer_Click" Header="{Binding [Page_ServerList_Setting], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 75 | + <MenuItem x:Name="setModorPlugin" Click="setModorPlugin_Click" Header="{Binding [Page_ServerList_ManageModsOrPlugins], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 76 | + <MenuItem x:Name="openServerDir" Click="openServerDir_Click" Header="{Binding [Page_ServerList_OpenDir], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 77 | + <MenuItem x:Name="delServer" Click="delServer_Click" Header="{Binding [Page_ServerList_Delete], Source={x:Static langs:LanguageManager.Instance}}" IsEnabled="False"/> |
| 78 | + </ContextMenu> |
| 79 | + </controls:MagicListBox.ContextMenu> |
| 80 | + </controls:MagicListBox> |
| 81 | + <!-- |
26 | 82 | <Border Grid.Row="1" CornerRadius="10" BorderThickness="0" Background="{DynamicResource BackgroundBrush}"> |
27 | 83 | <ListView x:Name="serverList" hc:Empty.ShowEmpty="true" MouseDoubleClick="serverList_MouseDoubleClick" FontSize="16" SelectionMode="Single" SelectionChanged="serverList_SelectionChanged" Background="Transparent" BorderThickness="0"> |
28 | 84 | <ListView.ContextMenu> |
|
72 | 128 | </ListView.View> |
73 | 129 | </ListView> |
74 | 130 | </Border> |
| 131 | + --> |
75 | 132 | <Button Grid.Row="1" x:Name="addServer" Margin="20" HorizontalAlignment="Right" VerticalAlignment="Bottom" hc:IconElement.Geometry="{StaticResource AddGeometry}" hc:IconElement.Height="16" Style="{StaticResource ButtonPrimary}" hc:BorderElement.CornerRadius="30" Height="48" Width="48" Click="addServer_Click"/> |
76 | 133 | </Grid> |
77 | 134 | </controls:MagicCard> |
|
0 commit comments