45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using Qrakhen.Qamp.Memory;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
|
|
namespace Qrakhen.Qamp.Editor.ViewModel;
|
|
|
|
public class MainViewModel
|
|
{
|
|
|
|
}
|
|
|
|
public class FileViewModel : ObservableObject
|
|
{
|
|
public ObservableCollection<LineBuffer> Lines { get; private set; } = new() {
|
|
new LineBuffer("test"),
|
|
new LineBuffer(" is very good;"),
|
|
new LineBuffer(" jaja();"),
|
|
new LineBuffer("}")
|
|
};
|
|
}
|
|
|
|
public abstract class ObservableObject : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
protected bool SetProperty<T>([NotNullIfNotNull("newValue")] ref T field, T newValue, [CallerMemberName] string? propertyName = null)
|
|
{
|
|
if (EqualityComparer<T>.Default.Equals(field, newValue))
|
|
return false;
|
|
|
|
field = newValue;
|
|
OnPropertyChanged(propertyName);
|
|
return true;
|
|
}
|
|
|
|
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
} |