Move Resource usage display

This commit is contained in:
Timothy Baldridge 2022-05-20 16:33:09 -06:00
parent 7ab7565d16
commit ec4586cd82
3 changed files with 20 additions and 12 deletions

View File

@ -67,6 +67,9 @@ namespace Wabbajack
[Reactive]
public string ResourceStatus { get; set; }
[Reactive]
public string AppName { get; set; }
[Reactive]
public bool UpdateAvailable { get; private set; }
@ -130,6 +133,7 @@ namespace Wabbajack
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
Consts.CurrentMinimumWabbajackVersion = Version.Parse(fvi.FileVersion);
VersionDisplay = $"v{fvi.FileVersion}";
AppName = "WABBAJACK " + VersionDisplay;
_logger.LogInformation("Wabbajack Version: {FileVersion}", fvi.FileVersion);
Task.Run(() => _wjClient.SendMetric("started_wabbajack", fvi.FileVersion)).FireAndForget();

View File

@ -31,12 +31,19 @@
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<TextBlock FontSize="16" Margin="0, 0, 8, 0">WABBAJACK 3.0.0</TextBlock>
<Button Name="SettingsButton">
<Grid Grid.Row="0" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="140"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" FontSize="16" Margin="0, 0, 8, 0" Name="AppName"></TextBlock>
<TextBlock Grid.Column="1" Margin="5, 0" Name="ResourceUsage" HorizontalAlignment="Right"></TextBlock>
<Button Grid.Column="2" Name="SettingsButton">
<icon:Material Kind="Cog"></icon:Material>
</Button>
</StackPanel>
</Grid>
<ContentPresenter Grid.Row="1" Content="{Binding ActivePane}">
<ContentPresenter.Resources>
<DataTemplate DataType="{x:Type local:CompilerVM}">
@ -62,7 +69,7 @@
</DataTemplate>
</ContentPresenter.Resources>
</ContentPresenter>
<TextBlock Grid.Row="1" Margin="5, 0" Name="ResourceUsage" HorizontalAlignment="Right"></TextBlock>
</Grid>
<mahapps:MetroWindow.RightWindowCommands>

View File

@ -119,15 +119,12 @@ namespace Wabbajack
_logger.LogError(ex, "During Main Window Startup");
Environment.Exit(-1);
}
/*
vm.WhenAnyValue(vm => vm.ResourceStatus)
.BindToStrict(this, view => view.ResourceUsage.Text);
vm.WhenAnyValue(vm => vm.ResourceStatus)
.Select(x => string.IsNullOrWhiteSpace(x) ? Visibility.Collapsed : Visibility.Visible)
.BindToStrict(this, view => view.ResourceUsage.Visibility);*/
vm.WhenAnyValue(vm => vm.AppName)
.BindToStrict(this, view => view.AppName.Text);
}
public void Init(MainWindowVM vm, MainSettings settings)