0
0
mirror of https://github.com/sp-tarkov/patcher.git synced 2025-02-13 08:10:47 -05:00
patcher/Patcher/PatchGenerator/Views/PatchGenerationView.axaml.cs

37 lines
953 B
C#

using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using PatchGenerator.AttachedProperties;
using PatchGenerator.ViewModels;
using ReactiveUI;
namespace PatchGenerator.Views
{
public partial class PatchGenerationView : ReactiveUserControl<PatchGenerationViewModel>
{
public PatchGenerationView()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.WhenActivated(disposables => { });
AvaloniaXamlLoader.Load(this);
}
public void scrollChanged(object sender, ScrollChangedEventArgs e)
{
if (sender is ScrollViewer scrollViewer)
{
bool autoScroll = scrollViewer.GetValue(RandomBoolAttProp.RandomBoolProperty);
if (autoScroll)
{
scrollViewer.ScrollToEnd();
}
}
}
}
}