340 lines
11 KiB
XML
340 lines
11 KiB
XML
<Window
|
|
xmlns="https://github.com/avaloniaui"
|
|
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:modpackUpdater="clr-namespace:ModpackUpdater;assembly=ModpackUpdater"
|
|
xmlns:local="clr-namespace:ModpackUpdater.Apps.Manager.Ui"
|
|
xmlns:manager="clr-namespace:ModpackUpdater.Apps.Manager"
|
|
xmlns:vm="clr-namespace:ModpackUpdater.Apps.Manager.Ui.Models"
|
|
xmlns:controls="https://git.pilzinsel64.de/pilz-framework/pilz"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Title="Minecraft Modpack Manager"
|
|
Padding="3"
|
|
Loaded="Window_OnLoaded">
|
|
|
|
<Grid
|
|
RowDefinitions="Auto,*">
|
|
|
|
<Menu>
|
|
<Menu.Items>
|
|
<MenuItem x:Name="MenuItemWorkspace" Header="Workspace">
|
|
|
|
<MenuItem.Items>
|
|
<MenuItem x:Name="MenuItemWorkspacePreferences" Header="Workspace preferences"/>
|
|
<MenuItem x:Name="MenuItemSaveWorkspace" Header="Save workspace"/>
|
|
<Separator/>
|
|
<MenuItem x:Name="MenuItemNewWorkspace" Header="New workspace"/>
|
|
<Separator/>
|
|
<MenuItem x:Name="MenuItemRecentWorkspaces" Header="Recent workspaces"/>
|
|
</MenuItem.Items>
|
|
</MenuItem>
|
|
|
|
<MenuItem x:Name="MenuItemTools" Header="Tools"/>
|
|
</Menu.Items>
|
|
</Menu>
|
|
|
|
<!-- Tree view -->
|
|
<Grid
|
|
x:Name="GridMain"
|
|
Grid.Row="1"
|
|
ColumnDefinitions="300,*,300"
|
|
Margin="3">
|
|
|
|
<StackPanel
|
|
Grid.Column="0"
|
|
Margin="3"
|
|
Spacing="6">
|
|
|
|
<Menu>
|
|
<Menu.Items>
|
|
<MenuItem x:Name="MenuItemCreateUpdate" Header="Create" Click="MenuItemCreateUpdate_OnClick"/>
|
|
<MenuItem x:Name="MenuItemEditUpdate" Header="Edit" Click="MenuItemEditUpdate_OnClick"/>
|
|
<MenuItem x:Name="MenuItemRemoveUpdate" Header="Remove" Click="MenuItemRemoveUpdate_OnClick"/>
|
|
</Menu.Items>
|
|
</Menu>
|
|
|
|
<ScrollViewer
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<StackPanel>
|
|
<TreeView
|
|
ItemsSource="{Binding CurrentTreeNodes}"
|
|
SelectedItem="{Binding SelectedTreeNode}">
|
|
|
|
<TreeView.ItemTemplate>
|
|
<TreeDataTemplate
|
|
ItemsSource="{Binding Nodes}">
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image Source="{Binding Image}" Width="16"/>
|
|
<TextBlock Text="{Binding DisplayText}"/>
|
|
</StackPanel>
|
|
</TreeDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
</TreeView>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</StackPanel>
|
|
|
|
<!-- List editor -->
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
Margin="3"
|
|
Spacing="6">
|
|
|
|
<!-- Header -->
|
|
<ContentControl
|
|
Content="{Binding SelectedTreeNode}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
<DataTemplate
|
|
DataType="vm:ActionSetTreeNode">
|
|
|
|
<StackPanel
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<controls:ImageButton
|
|
x:Name="ButtonAddAction"
|
|
Text="Add"
|
|
ImageSource="{x:Static local:MainWindow.ButtonImageAddAction}"
|
|
Background="Transparent"
|
|
Click="ButtonAddAction_OnClick"/>
|
|
|
|
<controls:ImageButton
|
|
x:Name="ButtonRemoveAction"
|
|
Text="Remove"
|
|
ImageSource="{x:Static local:MainWindow.ButtonImageRemoveAction}"
|
|
Background="Transparent"
|
|
Click="ButtonRemoveAction_OnClick"/>
|
|
|
|
<TextBox
|
|
Width="100"
|
|
Text="{Binding Version}"/>
|
|
|
|
<CheckBox
|
|
Content="Public"
|
|
IsChecked="{Binding IsPublic}"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
|
|
<DataTemplate
|
|
DataType="vm:MainWindowTreeNode"/>
|
|
</ContentControl.DataTemplates>
|
|
</ContentControl>
|
|
|
|
<!-- DataGrid -->
|
|
<DataGrid
|
|
x:Name="DataGridActions"
|
|
VerticalAlignment="Stretch"
|
|
ItemsSource="{Binding CurrentGridRows}"
|
|
SelectedItem="{Binding SelectedGridRow}">
|
|
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn
|
|
Header="Id"
|
|
Binding="{Binding InheritedId}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Side"
|
|
Binding="{Binding InheritedSide}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Update type"
|
|
Binding="{Binding InheritedUpdateType}"
|
|
IsVisible="{Binding IsUpdate}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Source type"
|
|
Binding="{Binding InheritedSourceType}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Dest path"
|
|
Binding="{Binding InheritedDestPath}"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</StackPanel>
|
|
|
|
<!-- Action editor -->
|
|
<ScrollViewer
|
|
x:Name="ScrollViewerInstallAction"
|
|
Grid.Column="2"
|
|
Margin="3"
|
|
DataContext="{Binding SelectedGridRow}"
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<StackPanel
|
|
Spacing="6">
|
|
|
|
<!-- Update -->
|
|
<StackPanel
|
|
Spacing="6"
|
|
IsVisible="{Binding IsUpdate}">
|
|
|
|
<!-- Header -->
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image x:Name="ImageUpdate"/>
|
|
<TextBlock Text="Update" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Inherit from -->
|
|
<Label Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
|
|
<TextBox
|
|
x:Name="TextBoxUpdateActionInheritFrom"
|
|
Text="{Binding InheritFrom}"/>
|
|
|
|
<!-- Source type -->
|
|
<Label Content="Source type" Target="ComboBoxUpdateActionSourceType"/>
|
|
<ComboBox
|
|
x:Name="ComboBoxUpdateActionSourceType"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.UpdateActionTypes}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding UpdateType}"/>
|
|
|
|
<!-- Is Directory -->
|
|
<CheckBox
|
|
x:Name="CheckBoxUpdateActionIsDir"
|
|
Content="Is Directory"
|
|
IsChecked="{Binding IsDirectory}"/>
|
|
</StackPanel>
|
|
|
|
<!-- General -->
|
|
<StackPanel
|
|
Spacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image x:Name="ImageGeneral"/>
|
|
<TextBlock Text="General" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Id -->
|
|
<Label Content="Id" Target="TextBoxInstallActionId"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionId"
|
|
Text="{Binding Id}"/>
|
|
|
|
<!-- Name -->
|
|
<Label Content="Name" Target="TextBoxInstallActionName"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionName"
|
|
Text="{Binding Name}"/>
|
|
|
|
<!-- Side -->
|
|
<Label Content="Side" Target="ComboBoxInstallActionSide"/>
|
|
<ComboBox
|
|
x:Name="ComboBoxInstallActionSide"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.Sides}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding Side}"/>
|
|
|
|
<!-- Is Extra -->
|
|
<CheckBox
|
|
x:Name="CheckBoxInstallActionIsExtra"
|
|
Content="Is Extra"
|
|
IsChecked="{Binding IsExtra}"/>
|
|
</StackPanel>
|
|
|
|
<!-- Destination -->
|
|
<StackPanel
|
|
Spacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image x:Name="ImageDestination"/>
|
|
<TextBlock Text="Destination" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Destination path -->
|
|
<TextBox
|
|
x:Name="TextBoxInstallDestPath"
|
|
Text="{Binding DestPath}"/>
|
|
</StackPanel>
|
|
|
|
<!-- Source -->
|
|
<StackPanel
|
|
Spacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image x:Name="ImageSource"/>
|
|
<TextBlock Text="Source" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Source types -->
|
|
<Label Content="Source type" Target="CheckBoxInstallActionSourceType"/>
|
|
<ComboBox
|
|
x:Name="CheckBoxInstallActionSourceType"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.SourceTypes}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding SourceType}"/>
|
|
|
|
<!-- Is Zip -->
|
|
<CheckBox
|
|
x:Name="CheckBoxInstallActionIsZip"
|
|
Content="Is Zip archive"
|
|
IsChecked="{Binding IsZip}"/>
|
|
|
|
<!-- Source owner -->
|
|
<Label Content="Source owner" Target="TextBoxInstallActionSourceOwner"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionSourceOwner"
|
|
Text="{Binding SourceOwner}"/>
|
|
|
|
<!-- Source name -->
|
|
<Label Content="Source name" Target="TextBoxInstallActionSourceName"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionSourceName"
|
|
Text="{Binding SourceName}"/>
|
|
|
|
<!-- Source RegEx -->
|
|
<Label Content="Source RegEx" Target="TextBoxInstallActionSourceRegEx"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionSourceRegEx"
|
|
Text="{Binding SourceRegex}"/>
|
|
|
|
<!-- Source url -->
|
|
<Label Content="Source URL" Target="TextBoxInstallActionSourceUrl"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionSourceUrl" Text="{Binding SourceUrl}"/>
|
|
|
|
<!-- Zip archive path -->
|
|
<Label Content="ZIP archive path" Target="TextBoxInstallActionZipArchivePath"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionZipArchivePath"
|
|
Text="{Binding SourceUrl}"/>
|
|
|
|
<!-- Source path -->
|
|
<Label Content="Source path" Target="TextBoxInstallActionSourcePath"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionSourcePath"
|
|
Text="{Binding SrcPath}"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
Margin="3"
|
|
Spacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image x:Name="ImageMetadata"/>
|
|
<TextBlock Text="Metadata" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Website -->
|
|
<Label Content="Website" Target="TextBoxInstallActionWebsite"/>
|
|
<TextBox
|
|
x:Name="TextBoxInstallActionWebsite"
|
|
Text="{Binding Website}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</Grid>
|
|
</Window> |