- add: Service think

This commit is contained in:
2024-12-22 16:38:47 +03:00
parent d9161f837b
commit 4d64c995f1
38 changed files with 4625 additions and 80 deletions

View File

@@ -17,7 +17,7 @@
Grid.Column="0"
Grid.Row="0"
Padding="10">
<Label>Server name</Label>
<TextBlock x:Name="ServerNameLabel">Server name</TextBlock>
</Border>
<Border
BorderThickness="2,0,0,0"

View File

@@ -1,9 +1,23 @@
using Avalonia;
using Avalonia.Controls;
namespace Nebula.Launcher.Views.Controls;
public partial class ServerContainerControl : UserControl
{
public static readonly StyledProperty<string> ServerNameProperty
= AvaloniaProperty.Register<ServerContainerControl, string>(nameof (ServerName));
public string ServerName
{
get => GetValue(ServerNameProperty);
set
{
SetValue(ServerNameProperty, value);
ServerNameLabel.Text = value;
}
}
public ServerContainerControl()
{
InitializeComponent();

View File

@@ -2,29 +2,34 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d"
x:Class="Nebula.Launcher.Views.Pages.ServerListView"
x:DataType="pages:ServerListView"
x:Class="Nebula.Launcher.Views.Pages.ServerListView"
x:DataType="viewModels:ServerListViewModel"
xmlns="https://github.com/avaloniaui"
xmlns:controls="clr-namespace:Nebula.Launcher.Views.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pages="clr-namespace:Nebula.Launcher.Views.Pages">
xmlns:models="clr-namespace:Nebula.Launcher.Models"
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.DataContext>
<viewModels:ServerListViewModel />
</Design.DataContext>
<Grid ColumnDefinitions="*" RowDefinitions="*,40">
<ScrollViewer Margin="0,0,0,10" Padding="0,0,8,0">
<StackPanel>
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
<controls:ServerContainerControl />
</StackPanel>
<ListBox
Background="#00000000"
ItemsSource="{Binding ServerInfos}"
Padding="0">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:ServerInfo}">
<controls:ServerContainerControl ServerName="{Binding StatusData.Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
<Border
BorderThickness="2,0,0,0"
CornerRadius="10"