wabbajack/Wabbajack.App/Controls/LogView.axaml.cs

25 lines
778 B
C#
Raw Normal View History

2021-11-08 13:32:51 +00:00
using System.Linq;
2021-10-12 05:19:13 +00:00
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.ReactiveUI;
using Microsoft.Extensions.DependencyInjection;
using ReactiveUI;
namespace Wabbajack.App.Controls;
public partial class LogView : ReactiveUserControl<LogViewModel>
{
public LogView()
{
DataContext = App.Services.GetService<LogViewModel>()!;
InitializeComponent();
this.WhenActivated(disposables =>
{
2021-11-08 13:32:51 +00:00
this.OneWayBind(ViewModel, vm => vm.Messages, view => view.Messages.Items,
items => items.Reverse().ToArray())
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.CopyLogFile, view => view.CopyLog)
.DisposeWith(disposables);
});
}
}