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

28 lines
954 B
C#
Raw Normal View History

2021-10-21 12:57:02 +00:00
using System.Reactive.Disposables;
using Avalonia.ReactiveUI;
using FluentFTP.Helpers;
using ReactiveUI;
namespace Wabbajack.App.Controls;
public partial class ResourceView : ReactiveUserControl<ResourceViewModel>, IActivatableView
{
public ResourceView()
{
InitializeComponent();
this.WhenActivated(disposables =>
{
this.OneWayBind(ViewModel, vm => vm.Name, view => view.ResourceName.Text)
.DisposeWith(disposables);
2021-10-23 16:51:17 +00:00
2021-10-21 12:57:02 +00:00
this.Bind(ViewModel, vm => vm.MaxTasks, view => view.MaxTasks.Text)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.MaxThroughput, view => view.MaxThroughput.Text)
.DisposeWith(disposables);
2021-10-23 16:51:17 +00:00
2021-10-21 12:57:02 +00:00
this.OneWayBind(ViewModel, vm => vm.CurrentThroughput, view => view.CurrentThrougput.Text,
val => val.FileSizeToString())
.DisposeWith(disposables);
});
}
}