29 lines
953 B
C#
29 lines
953 B
C#
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Flawless.Client.Models;
|
|
using ReactiveUI;
|
|
using ReactiveUI.SourceGenerators;
|
|
|
|
namespace Flawless.Client.ViewModels.ModalBox;
|
|
|
|
public partial class IssueEditDialogViewModel : ReactiveObject
|
|
{
|
|
[Reactive] public string Title { get; set; } = string.Empty;
|
|
[Reactive] public string Description { get; set; } = string.Empty;
|
|
[Reactive] public string? Tag { get; set; }
|
|
|
|
public bool IsEditMode { get; }
|
|
|
|
public List<string> AvailableTags { get; } = new() { "bug", "feature", "question" };
|
|
|
|
public IssueEditDialogViewModel(RepositoryModel.Issue? existingIssue = null)
|
|
{
|
|
IsEditMode = existingIssue != null;
|
|
if (IsEditMode)
|
|
{
|
|
Title = existingIssue!.Title;
|
|
Description = existingIssue.Description ?? string.Empty;
|
|
Tag = new StringBuilder().AppendJoin(',', existingIssue.Tags).ToString();
|
|
}
|
|
}
|
|
} |