Idk, dev work goin on
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WinWARP.Core.Models.Entities;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public abstract partial class ServerItemViewModel : ObservableObject
|
||||
{
|
||||
public ServerItemViewModel(Server server)
|
||||
{
|
||||
Id = server.Id;
|
||||
DefaultTitle = server.DefaultTitle;
|
||||
Title = server.Title;
|
||||
ConnectionString = server.ConnectionString;
|
||||
Region = server.Region;
|
||||
}
|
||||
|
||||
public int Id
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string DefaultTitle
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string Title
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string ConnectionString
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string Region
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
|
||||
[RelayCommand]
|
||||
public abstract Task DeleteAsync();
|
||||
|
||||
public abstract Task EditNameAsync();
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool IsNameEditing
|
||||
{
|
||||
get; set;
|
||||
} = false;
|
||||
|
||||
[RelayCommand]
|
||||
public void EditName()
|
||||
{
|
||||
if (IsNameEditing)
|
||||
EditNameAsync();
|
||||
IsNameEditing = !IsNameEditing;
|
||||
}
|
||||
|
||||
public ObservableCollection<string> Tags { get; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user