2019-12-08 22:30:49 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2020-01-11 06:43:40 +00:00
|
|
|
|
using System.Reactive.Disposables;
|
2019-12-08 22:30:49 +00:00
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
2019-11-29 22:09:22 +00:00
|
|
|
|
using System.Windows.Controls;
|
2019-12-08 22:30:49 +00:00
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
using System.Windows.Shapes;
|
2020-01-11 06:43:40 +00:00
|
|
|
|
using ReactiveUI;
|
|
|
|
|
using ReactiveUI.Fody.Helpers;
|
|
|
|
|
using Wabbajack.Lib;
|
|
|
|
|
using System.Windows.Controls.Primitives;
|
|
|
|
|
using System.Reactive.Linq;
|
2020-02-08 04:35:08 +00:00
|
|
|
|
using Wabbajack.Common;
|
2019-11-07 05:33:08 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-12-08 22:30:49 +00:00
|
|
|
|
/// Interaction logic for CpuView.xaml
|
2019-11-07 05:33:08 +00:00
|
|
|
|
/// </summary>
|
2020-01-11 06:43:40 +00:00
|
|
|
|
public partial class CpuView : UserControlRx<ICpuStatusVM>
|
2019-11-07 05:33:08 +00:00
|
|
|
|
{
|
2020-02-08 04:35:08 +00:00
|
|
|
|
public Percent ProgressPercent
|
2019-11-29 22:09:22 +00:00
|
|
|
|
{
|
2020-02-08 04:35:08 +00:00
|
|
|
|
get => (Percent)GetValue(ProgressPercentProperty);
|
2019-11-29 22:09:22 +00:00
|
|
|
|
set => SetValue(ProgressPercentProperty, value);
|
|
|
|
|
}
|
2020-02-08 04:35:08 +00:00
|
|
|
|
public static readonly DependencyProperty ProgressPercentProperty = DependencyProperty.Register(nameof(ProgressPercent), typeof(Percent), typeof(CpuView),
|
|
|
|
|
new FrameworkPropertyMetadata(default(Percent), WireNotifyPropertyChanged));
|
2019-11-29 22:09:22 +00:00
|
|
|
|
|
2020-01-11 06:43:40 +00:00
|
|
|
|
public MainSettings SettingsHook
|
|
|
|
|
{
|
|
|
|
|
get => (MainSettings)GetValue(SettingsHookProperty);
|
|
|
|
|
set => SetValue(SettingsHookProperty, value);
|
|
|
|
|
}
|
|
|
|
|
public static readonly DependencyProperty SettingsHookProperty = DependencyProperty.Register(nameof(SettingsHook), typeof(MainSettings), typeof(CpuView),
|
2020-01-20 21:59:26 +00:00
|
|
|
|
new FrameworkPropertyMetadata(default(SettingsVM), WireNotifyPropertyChanged));
|
2020-01-11 06:43:40 +00:00
|
|
|
|
|
|
|
|
|
private bool _ShowingSettings;
|
|
|
|
|
public bool ShowingSettings { get => _ShowingSettings; set => this.RaiseAndSetIfChanged(ref _ShowingSettings, value); }
|
|
|
|
|
|
2019-12-08 22:30:49 +00:00
|
|
|
|
public CpuView()
|
2019-11-07 05:33:08 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-01-11 06:43:40 +00:00
|
|
|
|
this.WhenActivated(disposable =>
|
|
|
|
|
{
|
2020-09-12 20:23:03 +00:00
|
|
|
|
|
2020-02-08 04:35:08 +00:00
|
|
|
|
this.WhenAny(x => x.ViewModel.StatusList)
|
|
|
|
|
.BindToStrict(this, x => x.CpuListControl.ItemsSource)
|
2020-01-11 06:43:40 +00:00
|
|
|
|
.DisposeWith(disposable);
|
|
|
|
|
|
2020-02-08 04:35:08 +00:00
|
|
|
|
// Progress
|
|
|
|
|
this.WhenAny(x => x.ProgressPercent)
|
|
|
|
|
.Select(p => p.Value)
|
|
|
|
|
.BindToStrict(this, x => x.HeatedBorderRect.Opacity)
|
2020-01-11 20:20:14 +00:00
|
|
|
|
.DisposeWith(disposable);
|
2020-01-11 06:43:40 +00:00
|
|
|
|
});
|
2019-11-07 05:33:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|