mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
WIP, probably won't use this code
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<TabItem x:Class="Wabbajack.Views.BrowserTabView"
|
<UserControl x:Class="Wabbajack.Views.BrowserTabView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@ -7,17 +7,10 @@
|
|||||||
xmlns:views="clr-namespace:Wabbajack.Views"
|
xmlns:views="clr-namespace:Wabbajack.Views"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
<TabItem.Style>
|
|
||||||
<Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}"></Style>
|
|
||||||
</TabItem.Style>
|
|
||||||
<TabItem.Header>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock FontSize="16" x:Name="HeaderText">_</TextBlock>
|
|
||||||
</StackPanel>
|
|
||||||
</TabItem.Header>
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<views:BrowserView x:Name="Browser">
|
<views:BrowserView x:Name="Browser">
|
||||||
</views:BrowserView>
|
</views:BrowserView>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</UserControl>
|
||||||
|
|
||||||
|
@ -13,19 +13,21 @@ public partial class BrowserTabView : IDisposable
|
|||||||
{
|
{
|
||||||
private readonly CompositeDisposable _compositeDisposable;
|
private readonly CompositeDisposable _compositeDisposable;
|
||||||
|
|
||||||
public BrowserTabView(BrowserTabViewModel vm)
|
public BrowserTabView()
|
||||||
{
|
{
|
||||||
_compositeDisposable = new CompositeDisposable();
|
_compositeDisposable = new CompositeDisposable();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Browser.Browser.Source = new Uri("http://www.google.com");
|
Browser.Browser.Source = new Uri("http://www.google.com");
|
||||||
|
|
||||||
|
/*
|
||||||
vm.Browser = Browser;
|
vm.Browser = Browser;
|
||||||
DataContext = vm;
|
|
||||||
|
|
||||||
vm.WhenAnyValue(vm => vm.HeaderText)
|
vm.WhenAnyValue(vm => vm.HeaderText)
|
||||||
.BindTo(this, view => view.HeaderText.Text)
|
.BindTo(this, view => view.HeaderText.Text)
|
||||||
.DisposeWith(_compositeDisposable);
|
.DisposeWith(_compositeDisposable);
|
||||||
|
*/
|
||||||
|
|
||||||
Start().FireAndForget();
|
//Start().FireAndForget();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Start()
|
private async Task Start()
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="clr-namespace:Wabbajack.View_Models"
|
xmlns:viewModels="clr-namespace:Wabbajack.View_Models"
|
||||||
xmlns:behaviors="clr-namespace:IKriv.Windows.Controls.Behaviors"
|
xmlns:behaviors="clr-namespace:IKriv.Windows.Controls.Behaviors"
|
||||||
|
xmlns:views="clr-namespace:Wabbajack.Views"
|
||||||
ShowTitleBar="False"
|
ShowTitleBar="False"
|
||||||
Title="WABBAJACK"
|
Title="WABBAJACK"
|
||||||
Width="1280"
|
Width="1280"
|
||||||
@ -23,6 +24,33 @@
|
|||||||
UseLayoutRounding="True"
|
UseLayoutRounding="True"
|
||||||
WindowTitleBrush="{StaticResource MahApps.Brushes.Accent}"
|
WindowTitleBrush="{StaticResource MahApps.Brushes.Accent}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<DataTemplate x:Key="HeaderTemplate">
|
||||||
|
<ContentPresenter Grid.Row="0" Content="{Binding}">
|
||||||
|
<ContentPresenter.Resources>
|
||||||
|
<DataTemplate DataType="{x:Type local:MainWindowVM}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock FontSize="16" Margin="0, 0, 8, 0">WABBAJACK 3.0.0</TextBlock>
|
||||||
|
<Button Name="SettingsButton">
|
||||||
|
<icon:Material Kind="Cog"></icon:Material>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate DataType="{x:Type local:BrowserTabViewModel}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock FontSize="16" Margin="0, 0, 8, 0" Text="{Binding HeaderText}"></TextBlock>
|
||||||
|
<Button Name="SettingsButton">
|
||||||
|
<icon:Material Kind="Close"></icon:Material>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentPresenter.Resources>
|
||||||
|
</ContentPresenter>
|
||||||
|
</DataTemplate>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid Background="#121212" MouseDown="UIElement_OnMouseDown">
|
<Grid Background="#121212" MouseDown="UIElement_OnMouseDown">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition></RowDefinition>
|
<RowDefinition></RowDefinition>
|
||||||
@ -35,53 +63,23 @@
|
|||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Rectangle.Fill>
|
</Rectangle.Fill>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<TabControl Grid.Row="0" x:Name="Tabs" behaviors:TabContent.IsCached="True">
|
<TabControl Grid.Row="0" x:Name="Tabs" behaviors:TabContent.IsCached="True"
|
||||||
|
ItemTemplate="{DynamicResource HeaderTemplate}">
|
||||||
<behaviors:TabContent.Template>
|
<behaviors:TabContent.Template>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Button>Sup></Button>
|
<ContentPresenter Content="{Binding}">
|
||||||
</DataTemplate>
|
|
||||||
</behaviors:TabContent.Template>
|
|
||||||
<!--
|
|
||||||
<TabItem>
|
|
||||||
<TabItem.Header>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock FontSize="16" Margin="0, 0, 8, 0">WABBAJACK 3.0.0</TextBlock>
|
|
||||||
<Button Name="SettingsButton"><icon:Material Kind="Cog"></icon:Material></Button>
|
|
||||||
</StackPanel>
|
|
||||||
</TabItem.Header>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"></RowDefinition>
|
|
||||||
<RowDefinition Height="Auto"></RowDefinition>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<ContentPresenter Grid.Row="0" Content="{Binding ActivePane}">
|
|
||||||
<ContentPresenter.Resources>
|
<ContentPresenter.Resources>
|
||||||
<DataTemplate DataType="{x:Type local:CompilerVM}">
|
<DataTemplate DataType="{x:Type local:MainWindowVM}">
|
||||||
<local:CompilerView ViewModel="{Binding}" />
|
<local:MainWindowContent></local:MainWindowContent>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type local:InstallerVM}">
|
|
||||||
<local:InstallationView ViewModel="{Binding}" />
|
<DataTemplate DataType="{x:Type local:BrowserTabViewModel}">
|
||||||
</DataTemplate>
|
<views:BrowserTabView></views:BrowserTabView>
|
||||||
<DataTemplate DataType="{x:Type local:ModeSelectionVM}">
|
|
||||||
<local:ModeSelectionView ViewModel="{Binding}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type local:ModListGalleryVM}">
|
|
||||||
<local:ModListGalleryView ViewModel="{Binding}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type local:WebBrowserVM}">
|
|
||||||
<local:WebBrowserView />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type local:SettingsVM}">
|
|
||||||
<local:SettingsView ViewModel="{Binding}" />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="{x:Type viewModels:ModListContentsVM}">
|
|
||||||
<local:ModListContentsView ViewModel="{Binding}" />
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ContentPresenter.Resources>
|
</ContentPresenter.Resources>
|
||||||
</ContentPresenter>
|
</ContentPresenter>
|
||||||
<TextBlock Grid.Row="1" Margin="5, 0" Name="ResourceUsage" HorizontalAlignment="Right"></TextBlock>
|
</DataTemplate>
|
||||||
</Grid>
|
</behaviors:TabContent.Template>
|
||||||
</TabItem> -->
|
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@ -96,12 +94,12 @@
|
|||||||
Command="{Binding CopyVersionCommand}"
|
Command="{Binding CopyVersionCommand}"
|
||||||
Content="{Binding VersionDisplay}">
|
Content="{Binding VersionDisplay}">
|
||||||
<Button.ToolTip>
|
<Button.ToolTip>
|
||||||
<ToolTip Content="Wabbajack Version
Click to copy to clipboard"/>
|
<ToolTip Content="Wabbajack Version
Click to copy to clipboard" />
|
||||||
</Button.ToolTip>
|
</Button.ToolTip>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="1"
|
<Button Grid.Column="1"
|
||||||
Margin="5,0"
|
Margin="5,0"
|
||||||
Command="{Binding OpenSettingsCommand}">
|
Command="{Binding OpenSettingsCommand}">
|
||||||
<icon:PackIconMaterial
|
<icon:PackIconMaterial
|
||||||
Width="17"
|
Width="17"
|
||||||
Height="17"
|
Height="17"
|
||||||
|
@ -1,16 +1,24 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using DynamicData;
|
||||||
|
using DynamicData.Binding;
|
||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
using ReactiveUI.Fody.Helpers;
|
||||||
using Wabbajack.Common;
|
using Wabbajack.Common;
|
||||||
|
using Wabbajack.DTOs;
|
||||||
|
using Wabbajack.DTOs.DownloadStates;
|
||||||
|
using Wabbajack.DTOs.Interventions;
|
||||||
using Wabbajack.Messages;
|
using Wabbajack.Messages;
|
||||||
using Wabbajack.Paths.IO;
|
using Wabbajack.Paths.IO;
|
||||||
|
using Wabbajack.UserIntervention;
|
||||||
using Wabbajack.Util;
|
using Wabbajack.Util;
|
||||||
using Wabbajack.Views;
|
using Wabbajack.Views;
|
||||||
|
|
||||||
@ -26,11 +34,17 @@ namespace Wabbajack
|
|||||||
private readonly ILogger<MainWindow> _logger;
|
private readonly ILogger<MainWindow> _logger;
|
||||||
private readonly SystemParametersConstructor _systemParams;
|
private readonly SystemParametersConstructor _systemParams;
|
||||||
|
|
||||||
|
private ObservableCollection<ViewModel> TabVMs = new ObservableCollectionExtended<ViewModel>();
|
||||||
|
|
||||||
public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor systemParams, LauncherUpdater updater, MainWindowVM vm)
|
public MainWindow(ILogger<MainWindow> logger, SystemParametersConstructor systemParams, LauncherUpdater updater, MainWindowVM vm)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_mwvm = vm;
|
_mwvm = vm;
|
||||||
DataContext = _mwvm;
|
Tabs.ItemsSource = TabVMs;
|
||||||
|
TabVMs.Add(vm);
|
||||||
|
|
||||||
|
TabVMs.Add(new ManualDownloadHandler() {Intervention = new ManualDownload(new Archive() {State = new Manual(){Url = new Uri("https://www.wabbajack.org")}})});
|
||||||
|
Tabs.SelectedItem = TabVMs.Last();
|
||||||
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_systemParams = systemParams;
|
_systemParams = systemParams;
|
||||||
@ -206,9 +220,9 @@ namespace Wabbajack
|
|||||||
|
|
||||||
private void OnOpenBrowserTab(OpenBrowserTab msg)
|
private void OnOpenBrowserTab(OpenBrowserTab msg)
|
||||||
{
|
{
|
||||||
var tab = new BrowserTabView(msg.ViewModel);
|
//var tab = new BrowserTabView(msg.ViewModel);
|
||||||
Tabs.Items.Add(tab);
|
//Tabs.Items.Add(tab);
|
||||||
Tabs.SelectedItem = tab;
|
//Tabs.SelectedItem = tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCloseBrowserTab(CloseBrowserTab msg)
|
private void OnCloseBrowserTab(CloseBrowserTab msg)
|
||||||
|
@ -1,12 +1,51 @@
|
|||||||
<UserControl x:Class="Wabbajack.App.Wpf.Views.MainWindowContent"
|
<UserControl x:Class="Wabbajack.MainWindowContent"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:Wabbajack.App.Wpf.Views"
|
xmlns:local="clr-namespace:Wabbajack"
|
||||||
|
xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
||||||
|
xmlns:viewModels="clr-namespace:Wabbajack.View_Models"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"></RowDefinition>
|
||||||
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ContentPresenter Grid.Row="0" Content="{Binding ActivePane}">
|
||||||
|
<ContentPresenter.Resources>
|
||||||
|
<DataTemplate DataType="{x:Type local:CompilerVM}">
|
||||||
|
<local:CompilerView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type local:InstallerVM}">
|
||||||
|
<local:InstallationView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type local:ModeSelectionVM}">
|
||||||
|
<local:ModeSelectionView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type local:ModListGalleryVM}">
|
||||||
|
<local:ModListGalleryView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type local:WebBrowserVM}">
|
||||||
|
<local:WebBrowserView />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type local:SettingsVM}">
|
||||||
|
<local:SettingsView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type viewModels:ModListContentsVM}">
|
||||||
|
<local:ModListContentsView ViewModel="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentPresenter.Resources>
|
||||||
|
</ContentPresenter>
|
||||||
|
<TextBlock Grid.Row="1" Margin="5, 0" Name="ResourceUsage" HorizontalAlignment="Right"></TextBlock>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
<!--
|
||||||
|
<TabItem>
|
||||||
|
<TabItem.Header>
|
||||||
|
|
||||||
|
</TabItem.Header>
|
||||||
|
|
||||||
|
</TabItem>-->
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Wabbajack.App.Wpf.Views;
|
namespace Wabbajack;
|
||||||
|
|
||||||
public partial class MainWindowContent : UserControl
|
public partial class MainWindowContent : UserControl
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user