mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix up NavigationVM not binding to NavigationView, fill icons on hover
This commit is contained in:
parent
62edef8768
commit
e42336131e
@ -1194,6 +1194,15 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="ic:SymbolIcon">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Button, AncestorLevel=1}, Path=IsMouseOver}" Value="True">
|
||||||
|
<Setter Property="IsFilled" Value="True" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="LargeButtonStyle" TargetType="{x:Type Button}">
|
<Style x:Key="LargeButtonStyle" TargetType="{x:Type Button}">
|
||||||
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
|
<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
|
||||||
@ -1306,6 +1315,15 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="ic:SymbolIcon">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Button, AncestorLevel=1}, Path=IsMouseOver}" Value="True">
|
||||||
|
<Setter Property="IsFilled" Value="True" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter Property="Foreground" Value="{StaticResource DisabledButtonForeground}" />
|
<Setter Property="Foreground" Value="{StaticResource DisabledButtonForeground}" />
|
||||||
@ -1329,6 +1347,15 @@
|
|||||||
<Setter Property="Focusable" Value="False" />
|
<Setter Property="Focusable" Value="False" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="BorderBrush" Value="Transparent" />
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Style.Resources>
|
||||||
|
<Style TargetType="ic:SymbolIcon">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Button, AncestorLevel=1}, Path=IsMouseOver}" Value="True">
|
||||||
|
<Setter Property="IsFilled" Value="True" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Style.Resources>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter Property="Foreground" Value="{StaticResource DisabledButtonForeground}" />
|
<Setter Property="Foreground" Value="{StaticResource DisabledButtonForeground}" />
|
||||||
|
@ -39,6 +39,9 @@ namespace Wabbajack
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public ViewModel ActivePane { get; private set; }
|
public ViewModel ActivePane { get; private set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public NavigationVM NavigationVM { get; private set; }
|
||||||
|
|
||||||
public ObservableCollectionExtended<IStatusMessage> Log { get; } = new ObservableCollectionExtended<IStatusMessage>();
|
public ObservableCollectionExtended<IStatusMessage> Log { get; } = new ObservableCollectionExtended<IStatusMessage>();
|
||||||
|
|
||||||
public readonly CompilerVM Compiler;
|
public readonly CompilerVM Compiler;
|
||||||
@ -47,7 +50,6 @@ namespace Wabbajack
|
|||||||
public readonly ModListGalleryVM Gallery;
|
public readonly ModListGalleryVM Gallery;
|
||||||
public readonly ModeSelectionVM ModeSelectionVM;
|
public readonly ModeSelectionVM ModeSelectionVM;
|
||||||
public readonly WebBrowserVM WebBrowserVM;
|
public readonly WebBrowserVM WebBrowserVM;
|
||||||
public readonly NavigationVM NavigationVM;
|
|
||||||
public readonly Lazy<ModListContentsVM> ModListContentsVM;
|
public readonly Lazy<ModListContentsVM> ModListContentsVM;
|
||||||
public readonly UserInterventionHandlers UserInterventionHandlers;
|
public readonly UserInterventionHandlers UserInterventionHandlers;
|
||||||
private readonly Client _wjClient;
|
private readonly Client _wjClient;
|
||||||
|
@ -22,20 +22,22 @@ namespace Wabbajack
|
|||||||
public class NavigationVM : ViewModel
|
public class NavigationVM : ViewModel
|
||||||
{
|
{
|
||||||
private readonly ILogger<NavigationVM> _logger;
|
private readonly ILogger<NavigationVM> _logger;
|
||||||
public ICommand BrowseCommand { get; }
|
|
||||||
public ICommand InstallCommand { get; }
|
|
||||||
public ICommand CompileCommand { get; }
|
|
||||||
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
|
|
||||||
public NavigationVM(ILogger<NavigationVM> logger)
|
public NavigationVM(ILogger<NavigationVM> logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
HomeCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView));
|
||||||
|
BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery));
|
||||||
InstallCommand = ReactiveCommand.Create(() =>
|
InstallCommand = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
LoadLastLoadedModlist.Send();
|
LoadLastLoadedModlist.Send();
|
||||||
NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Installer);
|
NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Installer);
|
||||||
});
|
});
|
||||||
CompileCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Compiler));
|
CompileCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Compiler));
|
||||||
BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery));
|
|
||||||
}
|
}
|
||||||
|
public ICommand HomeCommand { get; }
|
||||||
|
public ICommand BrowseCommand { get; }
|
||||||
|
public ICommand InstallCommand { get; }
|
||||||
|
public ICommand CompileCommand { get; }
|
||||||
|
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
<ColumnDefinition Width="128" />
|
<ColumnDefinition Width="128" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<local:NavigationView Grid.Column="0" />
|
<local:NavigationView Grid.Column="0" ViewModel="{Binding NavigationVM}" />
|
||||||
<Border Grid.Column="1" Margin="0" Background="{StaticResource ComplementaryBackgroundBrush}" x:Name="MainContent" Padding="28" CornerRadius="8">
|
<Border Grid.Column="1" Margin="0" Background="{StaticResource ComplementaryBackgroundBrush}" x:Name="MainContent" Padding="28" CornerRadius="8">
|
||||||
<ContentPresenter Content="{Binding ActivePane}" VerticalAlignment="Stretch">
|
<ContentPresenter Content="{Binding ActivePane}" VerticalAlignment="Stretch">
|
||||||
<ContentPresenter.Resources>
|
<ContentPresenter.Resources>
|
||||||
|
@ -27,6 +27,7 @@ namespace Wabbajack
|
|||||||
public ModeSelectionView()
|
public ModeSelectionView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
var vm = ViewModel;
|
||||||
this.WhenActivated(dispose =>
|
this.WhenActivated(dispose =>
|
||||||
{
|
{
|
||||||
this.WhenAnyValue(x => x.ViewModel.Modlists)
|
this.WhenAnyValue(x => x.ViewModel.Modlists)
|
||||||
|
@ -19,10 +19,10 @@ namespace Wabbajack
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.WhenActivated(dispose =>
|
this.WhenActivated(dispose =>
|
||||||
{
|
{
|
||||||
this.WhenAny(x => x.ViewModel.BrowseCommand)
|
this.BindCommand(ViewModel, vm => vm.BrowseCommand, v => v.BrowseButton)
|
||||||
.BindToStrict(this, x => x.BrowseButton.Command)
|
.DisposeWith(dispose);
|
||||||
|
this.BindCommand(ViewModel, vm => vm.HomeCommand, v => v.HomeButton)
|
||||||
.DisposeWith(dispose);
|
.DisposeWith(dispose);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this.WhenAny(x => x.ViewModel.InstallCommand)
|
this.WhenAny(x => x.ViewModel.InstallCommand)
|
||||||
.BindToStrict(this, x => x.InstallButton.Command)
|
.BindToStrict(this, x => x.InstallButton.Command)
|
||||||
|
Loading…
Reference in New Issue
Block a user