mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Finish NavigationView
This commit is contained in:
parent
e42336131e
commit
240e643567
@ -61,7 +61,6 @@ namespace Wabbajack
|
||||
|
||||
public ICommand CopyVersionCommand { get; }
|
||||
public ICommand ShowLoginManagerVM { get; }
|
||||
public ICommand OpenSettingsCommand { get; }
|
||||
public ICommand MinimizeCommand { get; }
|
||||
public ICommand MaximizeCommand { get; }
|
||||
public ICommand CloseCommand { get; }
|
||||
@ -72,7 +71,7 @@ namespace Wabbajack
|
||||
public string ResourceStatus { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string AppName { get; set; }
|
||||
public string WindowTitle { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool UpdateAvailable { get; private set; }
|
||||
@ -141,8 +140,7 @@ namespace Wabbajack
|
||||
|
||||
var fvi = FileVersionInfo.GetVersionInfo(string.IsNullOrWhiteSpace(assemblyLocation) ? processLocation : assemblyLocation);
|
||||
Consts.CurrentMinimumWabbajackVersion = Version.Parse(fvi.FileVersion);
|
||||
VersionDisplay = $"v{fvi.FileVersion}";
|
||||
AppName = $"{Consts.AppName} {VersionDisplay}";
|
||||
WindowTitle = $"{Consts.AppName}";
|
||||
_logger.LogInformation("Wabbajack Version: {FileVersion}", fvi.FileVersion);
|
||||
|
||||
Task.Run(() => _wjClient.SendMetric("started_wabbajack", fvi.FileVersion)).FireAndForget();
|
||||
@ -171,10 +169,6 @@ namespace Wabbajack
|
||||
{
|
||||
Clipboard.SetText($"Wabbajack {VersionDisplay}\n{ThisAssembly.Git.Sha}");
|
||||
});
|
||||
OpenSettingsCommand = ReactiveCommand.Create(
|
||||
canExecute: this.WhenAny(x => x.ActivePane)
|
||||
.Select(active => !object.ReferenceEquals(active, SettingsPane)),
|
||||
execute: () => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Settings));
|
||||
MinimizeCommand = ReactiveCommand.Create(Minimize);
|
||||
MaximizeCommand = ReactiveCommand.Create(Maximize);
|
||||
CloseCommand = ReactiveCommand.Create(Close);
|
||||
|
@ -16,6 +16,7 @@ using Wabbajack.DTOs;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
@ -33,11 +34,23 @@ namespace Wabbajack
|
||||
NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Installer);
|
||||
});
|
||||
CompileCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Compiler));
|
||||
SettingsCommand = ReactiveCommand.Create(
|
||||
/*
|
||||
canExecute: this.WhenAny(x => x.ActivePane)
|
||||
.Select(active => !object.ReferenceEquals(active, SettingsPane)),
|
||||
*/
|
||||
execute: () => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Settings));
|
||||
var processLocation = Process.GetCurrentProcess().MainModule?.FileName ?? throw new Exception("Process location is unavailable!");
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var assemblyLocation = assembly.Location;
|
||||
var fvi = FileVersionInfo.GetVersionInfo(string.IsNullOrWhiteSpace(assemblyLocation) ? processLocation : assemblyLocation);
|
||||
Version = $"{fvi.FileVersion}";
|
||||
}
|
||||
public ICommand HomeCommand { get; }
|
||||
public ICommand BrowseCommand { get; }
|
||||
public ICommand InstallCommand { get; }
|
||||
public ICommand CompileCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
|
||||
public ICommand SettingsCommand { get; }
|
||||
public string Version { get; }
|
||||
}
|
||||
}
|
||||
|
@ -41,20 +41,16 @@
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" FontSize="16" Padding="8, 8" Name="AppName"></TextBlock>
|
||||
<TextBlock Grid.Column="1" FontSize="16" Padding="8, 8" Name="ResourceUsage" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock>
|
||||
<Button Grid.Column="2" Style="{StaticResource IconBareButtonStyle}" Name="SettingsButton" Padding="12, 8" ToolTip="Open Wabbajack settings">
|
||||
<ic:SymbolIcon Symbol="Settings"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3" Style="{StaticResource IconBareButtonStyle}" Name="MinimizeButton" Padding="12, 8">
|
||||
<Button Grid.Column="2" Style="{StaticResource IconBareButtonStyle}" Name="MinimizeButton" Padding="12, 8">
|
||||
<ic:SymbolIcon Symbol="Subtract"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4" Style="{StaticResource IconBareButtonStyle}" Name="MaximizeButton" Padding="12, 8">
|
||||
<Button Grid.Column="3" Style="{StaticResource IconBareButtonStyle}" Name="MaximizeButton" Padding="12, 8">
|
||||
<ic:SymbolIcon Symbol="Maximize"/>
|
||||
</Button>
|
||||
<Button Grid.Column="5" Style="{StaticResource IconBareButtonStyle}" Name="CloseButton" Padding="12, 8">
|
||||
<Button Grid.Column="4" Style="{StaticResource IconBareButtonStyle}" Name="CloseButton" Padding="12, 8">
|
||||
<ic:SymbolIcon Symbol="ArrowExit"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
@ -116,9 +116,6 @@ namespace Wabbajack
|
||||
this.Topmost = false;
|
||||
};
|
||||
|
||||
((MainWindowVM) DataContext).WhenAnyValue(vm => vm.OpenSettingsCommand)
|
||||
.BindTo(this, view => view.SettingsButton.Command);
|
||||
|
||||
((MainWindowVM) DataContext).WhenAnyValue(vm => vm.MinimizeCommand)
|
||||
.BindTo(this, view => view.MinimizeButton.Command);
|
||||
|
||||
@ -128,10 +125,12 @@ namespace Wabbajack
|
||||
((MainWindowVM) DataContext).WhenAnyValue(vm => vm.CloseCommand)
|
||||
.BindTo(this, view => view.CloseButton.Command);
|
||||
|
||||
/*
|
||||
((MainWindowVM)DataContext).WhenAnyValue(vm => vm.Installer.InstallState)
|
||||
.ObserveOn(RxApp.MainThreadScheduler)
|
||||
.Select(v => v == InstallState.Installing ? Visibility.Collapsed : Visibility.Visible)
|
||||
.BindTo(this, view => view.SettingsButton.Visibility);
|
||||
*/
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -142,7 +141,7 @@ namespace Wabbajack
|
||||
|
||||
vm.WhenAnyValue(vm => vm.ResourceStatus)
|
||||
.BindToStrict(this, view => view.ResourceUsage.Text);
|
||||
vm.WhenAnyValue(vm => vm.AppName)
|
||||
vm.WhenAnyValue(vm => vm.WindowTitle)
|
||||
.BindToStrict(this, view => view.AppName.Text);
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
<RowDefinition Height="108"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="108"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button x:Name="HomeButton">
|
||||
<Grid>
|
||||
@ -28,7 +29,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ic:SymbolIcon VerticalAlignment="Center" HorizontalAlignment="Center" Symbol="Home" FontSize="48" />
|
||||
<TextBlock Grid.Row="1" FontWeight="DemiBold" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0, 10, 0, 0">
|
||||
<TextBlock Grid.Row="1" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0, 10, 0, 0">
|
||||
Home
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
@ -40,11 +41,36 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ic:SymbolIcon VerticalAlignment="Center" HorizontalAlignment="Center" Symbol="CloudArrowDown" FontSize="48" />
|
||||
<TextBlock Grid.Row="1" FontWeight="DemiBold" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4">
|
||||
<TextBlock Grid.Row="1" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4">
|
||||
Browse lists
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Button>
|
||||
<Button x:Name="CompileButton" Grid.Row="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ic:SymbolIcon VerticalAlignment="Center" HorizontalAlignment="Center" Symbol="Toolbox" FontSize="48" />
|
||||
<TextBlock Grid.Row="1" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4">
|
||||
Create a list
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Button>
|
||||
<Button x:Name="SettingsButton" Grid.Row="6" Margin="0, 0, 0, 10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ic:SymbolIcon VerticalAlignment="Center" HorizontalAlignment="Center" Symbol="Settings" FontSize="48" />
|
||||
<TextBlock Grid.Row="1" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4">
|
||||
Settings
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Button>
|
||||
<TextBlock x:Name="VersionTextBlock" Grid.Row="7" FontSize="12" HorizontalAlignment="Center" Margin="0, 0, 0, 10" Foreground="{StaticResource ForegroundBrush}" Opacity="0.66"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</rxui:ReactiveUserControl>
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wabbajack.Common;
|
||||
@ -23,6 +24,15 @@ namespace Wabbajack
|
||||
.DisposeWith(dispose);
|
||||
this.BindCommand(ViewModel, vm => vm.HomeCommand, v => v.HomeButton)
|
||||
.DisposeWith(dispose);
|
||||
this.BindCommand(ViewModel, vm => vm.CompileCommand, v => v.CompileButton)
|
||||
.DisposeWith(dispose);
|
||||
this.BindCommand(ViewModel, vm => vm.SettingsCommand, v => v.SettingsButton)
|
||||
.DisposeWith(dispose);
|
||||
|
||||
this.WhenAny(x => x.ViewModel.Version)
|
||||
.Select(version => $"v{version}")
|
||||
.BindToStrict(this, v => v.VersionTextBlock.Text)
|
||||
.DisposeWith(dispose);
|
||||
/*
|
||||
this.WhenAny(x => x.ViewModel.InstallCommand)
|
||||
.BindToStrict(this, x => x.InstallButton.Command)
|
||||
|
Loading…
x
Reference in New Issue
Block a user