mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Created basic ManifestView, Window and VM
This commit is contained in:
parent
5b5678363f
commit
7b66aee5a8
@ -308,7 +308,10 @@ namespace Wabbajack
|
||||
.ToGuiProperty(this, nameof(ModListName));
|
||||
|
||||
// Define commands
|
||||
//ShowManifestCommand = ReactiveCommand.Create(ShowReport);
|
||||
ShowManifestCommand = ReactiveCommand.Create(() =>
|
||||
{
|
||||
new ManifestWindow(ModList.SourceModList).Show();
|
||||
});
|
||||
OpenReadmeCommand = ReactiveCommand.Create(
|
||||
execute: () => this.ModList?.OpenReadmeWindow(),
|
||||
canExecute: this.WhenAny(x => x.ModList)
|
||||
|
14
Wabbajack/View Models/ManifestVM.cs
Normal file
14
Wabbajack/View Models/ManifestVM.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Wabbajack.Lib;
|
||||
|
||||
namespace Wabbajack.View_Models
|
||||
{
|
||||
public class ManifestVM : ViewModel
|
||||
{
|
||||
public readonly Manifest Manifest;
|
||||
|
||||
public ManifestVM(ModList modlist)
|
||||
{
|
||||
Manifest = new Manifest(modlist);
|
||||
}
|
||||
}
|
||||
}
|
37
Wabbajack/Views/ManifestView.xaml
Normal file
37
Wabbajack/Views/ManifestView.xaml
Normal file
@ -0,0 +1,37 @@
|
||||
<reactiveUi:ReactiveUserControl x:TypeArguments="viewModels:ManifestVM" x:Class="Wabbajack.ManifestView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Wabbajack"
|
||||
xmlns:reactiveUi="http://reactiveui.net"
|
||||
xmlns:viewModels="clr-namespace:Wabbajack.View_Models"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<ScrollViewer>
|
||||
<Grid Margin="8">
|
||||
<TextBlock x:Name="Name" FontSize="20"/>
|
||||
</Grid>
|
||||
|
||||
<!--<ItemsControl Margin="8" x:Name="ManifestItemsControl">
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate x:Key="HeaderTemplate">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding Path=Text}" FontSize="20"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ScrollViewer />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplateSelector>
|
||||
<DataTemplateSelector x:Name="DataTemplateSelector"/>
|
||||
</ItemsControl.ItemTemplateSelector>
|
||||
|
||||
</ItemsControl>-->
|
||||
</ScrollViewer>
|
||||
</reactiveUi:ReactiveUserControl>
|
25
Wabbajack/Views/ManifestView.xaml.cs
Normal file
25
Wabbajack/Views/ManifestView.xaml.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.Reactive.Disposables;
|
||||
using ReactiveUI;
|
||||
using Wabbajack.Lib;
|
||||
using Wabbajack.View_Models;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
public partial class ManifestView
|
||||
{
|
||||
public ModList Modlist { get; set; }
|
||||
|
||||
public ManifestView(ModList modlist)
|
||||
{
|
||||
Modlist = modlist;
|
||||
InitializeComponent();
|
||||
ViewModel = new ManifestVM(modlist);
|
||||
|
||||
this.WhenActivated(disposable =>
|
||||
{
|
||||
this.Bind(ViewModel, x => x.Manifest.Name, x => x.Name.Text)
|
||||
.DisposeWith(disposable);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
11
Wabbajack/Views/ManifestWindow.xaml
Normal file
11
Wabbajack/Views/ManifestWindow.xaml
Normal file
@ -0,0 +1,11 @@
|
||||
<Window x:Class="Wabbajack.ManifestWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Wabbajack"
|
||||
mc:Ignorable="d"
|
||||
Title="ManifestWindow" Height="450" Width="800" d:DataContext="{d:DesignInstance local:ManifestWindow }">
|
||||
<Grid x:Name="Grid">
|
||||
</Grid>
|
||||
</Window>
|
16
Wabbajack/Views/ManifestWindow.xaml.cs
Normal file
16
Wabbajack/Views/ManifestWindow.xaml.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Wabbajack.Lib;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
public partial class ManifestWindow
|
||||
{
|
||||
public ModList Modlist { get; set; }
|
||||
|
||||
public ManifestWindow(ModList modlist)
|
||||
{
|
||||
Modlist = modlist;
|
||||
InitializeComponent();
|
||||
Grid.Children.Add(new ManifestView(Modlist));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user