Initial commit to new repository
This commit is contained in:
62
.decompiledproj/AxCopilot/ViewModels/PromptTemplateRow.cs
Normal file
62
.decompiledproj/AxCopilot/ViewModels/PromptTemplateRow.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace AxCopilot.ViewModels;
|
||||
|
||||
public class PromptTemplateRow : INotifyPropertyChanged
|
||||
{
|
||||
private string _name = "";
|
||||
|
||||
private string _content = "";
|
||||
|
||||
private string _icon = "\ue8bd";
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
set
|
||||
{
|
||||
_name = value;
|
||||
OnPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
|
||||
public string Content
|
||||
{
|
||||
get
|
||||
{
|
||||
return _content;
|
||||
}
|
||||
set
|
||||
{
|
||||
_content = value;
|
||||
OnPropertyChanged("Content");
|
||||
OnPropertyChanged("Preview");
|
||||
}
|
||||
}
|
||||
|
||||
public string Icon
|
||||
{
|
||||
get
|
||||
{
|
||||
return _icon;
|
||||
}
|
||||
set
|
||||
{
|
||||
_icon = value;
|
||||
OnPropertyChanged("Icon");
|
||||
}
|
||||
}
|
||||
|
||||
public string Preview => (Content.Length > 60) ? (Content.Substring(0, 57).Replace("\n", " ") + "…") : Content.Replace("\n", " ");
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string? n = null)
|
||||
{
|
||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(n));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user