Replace ReactiveUI
This commit is contained in:
parent
43b4d50e43
commit
5584ab4ec8
41 changed files with 472 additions and 1013 deletions
|
|
@ -0,0 +1,30 @@
|
|||
using System.Reactive.Linq;
|
||||
|
||||
using AvaloniaEdit.Document;
|
||||
|
||||
using Dock.Model.Mvvm.Controls;
|
||||
|
||||
using DynamicData.Binding;
|
||||
|
||||
using InkForge.Desktop.Models;
|
||||
|
||||
namespace InkForge.Desktop.ViewModels.Documents;
|
||||
|
||||
public class NoteEditDocumentViewModel : Document
|
||||
{
|
||||
public Note Note { get; }
|
||||
|
||||
public TextDocument Document { get; }
|
||||
|
||||
public NoteEditDocumentViewModel(Note note, TextDocument textDocument)
|
||||
{
|
||||
Note = note;
|
||||
Document = textDocument;
|
||||
|
||||
Observable.CombineLatest(
|
||||
this.WhenValueChanged(v => v.Note.Name),
|
||||
this.WhenValueChanged(v => v.Document.UndoStack.IsOriginalFile),
|
||||
(name, original) => original ? name : $"{name} *"
|
||||
).Subscribe(title => Title = title!);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue