Skip to content

Commit

Permalink
Dispose subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Elscrux committed Feb 18, 2024
1 parent 8670432 commit 2582a90
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CreationEditor.Avalonia/Views/Record/RecordList.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ public RecordList() {
.DisposeWith(disposables);

RecordGrid.Columns.ObserveCollectionChanges()
.Subscribe(_ => Sort());
.Subscribe(_ => Sort())
.DisposeWith(disposables);
});
}

public RecordList(IRecordListVM vm) : this() {
ViewModel = vm;
}

public object? SearchItems(string search) {
return ViewModel?.Records?
.OfType<IReferencedRecord>()
.FirstOrDefault(record => record.Record.EditorID is not null && record.Record.EditorID.StartsWith(search, StringComparison.OrdinalIgnoreCase));
}

public RecordList(IRecordListVM vm) : this() {
ViewModel = vm;
}

protected override void OnLoaded(RoutedEventArgs e) {
base.OnLoaded(e);

Expand Down

0 comments on commit 2582a90

Please sign in to comment.