2021-10-12 05:19:13 +00:00
|
|
|
using Avalonia.Controls;
|
2021-10-12 03:49:01 +00:00
|
|
|
using Avalonia.Controls.Mixins;
|
|
|
|
using Avalonia.ReactiveUI;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using ReactiveUI;
|
|
|
|
using Wabbajack.App.Utilities;
|
|
|
|
|
|
|
|
namespace Wabbajack.App.Controls;
|
|
|
|
|
|
|
|
public partial class LogView : ReactiveUserControl<LogViewModel>
|
|
|
|
{
|
|
|
|
public LogView()
|
|
|
|
{
|
|
|
|
DataContext = App.Services.GetService<LogViewModel>()!;
|
|
|
|
InitializeComponent();
|
|
|
|
this.WhenActivated(disposables =>
|
|
|
|
{
|
|
|
|
this.OneWayBind(ViewModel, vm => vm.Messages, view => view.Messages.Items)
|
|
|
|
.DisposeWith(disposables);
|
|
|
|
});
|
|
|
|
}
|
2021-10-12 05:19:13 +00:00
|
|
|
|
|
|
|
private void ScrollViewer_OnScrollChanged(object? sender, ScrollChangedEventArgs e)
|
|
|
|
{
|
|
|
|
ScrollViewer.ScrollToEnd();
|
|
|
|
}
|
2021-10-12 03:49:01 +00:00
|
|
|
}
|