mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
MainWindowVM
This commit is contained in:
parent
4f8167555d
commit
4f6c8b4aae
23
Wabbajack/View Models/MainWindowVM.cs
Normal file
23
Wabbajack/View Models/MainWindowVM.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using ReactiveUI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Wabbajack.Lib;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
public class MainWindowVM : ViewModel
|
||||
{
|
||||
public AppState AppState { get; }
|
||||
|
||||
private ViewModel _ActivePane;
|
||||
public ViewModel ActivePane { get => _ActivePane; set => this.RaiseAndSetIfChanged(ref _ActivePane, value); }
|
||||
|
||||
public MainWindowVM(RunMode mode)
|
||||
{
|
||||
this.AppState = new AppState(mode);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
Style="{StaticResource {x:Type Window}}"
|
||||
WindowStyle="ToolWindow"
|
||||
mc:Ignorable="d">
|
||||
<Viewbox Stretch="Uniform">
|
||||
<Viewbox Stretch="Uniform" DataContext="{Binding AppState}">
|
||||
<Grid Margin="4,0,4,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -23,10 +23,11 @@ namespace Wabbajack
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
var context = new AppState(mode);
|
||||
var mainVM = new MainWindowVM(mode);
|
||||
var context = mainVM.AppState;
|
||||
context.LogMsg($"Wabbajack Build - {ThisAssembly.Git.Sha}");
|
||||
SetupHandlers(context);
|
||||
DataContext = context;
|
||||
DataContext = mainVM;
|
||||
|
||||
Utils.SetLoggerFn(s => context.LogMsg(s));
|
||||
Utils.SetStatusFn((msg, progress) => WorkQueue.Report(msg, progress));
|
||||
|
@ -227,6 +227,7 @@
|
||||
<Compile Include="Converters\IsNotNullVisibilityConverter.cs" />
|
||||
<Compile Include="Enums\RunMode.cs" />
|
||||
<Compile Include="Extensions\ReactiveUIExt.cs" />
|
||||
<Compile Include="View Models\MainWindowVM.cs" />
|
||||
<Compile Include="Views\SlideshowView.xaml.cs">
|
||||
<DependentUpon>SlideshowView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
Loading…
Reference in New Issue
Block a user