small ui updates
This commit is contained in:
parent
bbf905495c
commit
21fc25741b
3 changed files with 67 additions and 8 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
<FileVersion>1.2.1</FileVersion>
|
<FileVersion>2.0.0-b1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="96" />
|
<RowDefinition Height="96" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="24" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Image Grid.Row="0"
|
<Image Grid.Row="0"
|
||||||
|
|
@ -50,17 +51,31 @@
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Expander Header="{Binding Title}" Margin="16, 8" HorizontalAlignment="Stretch">
|
<Expander Header="{Binding Title}" Margin="16, 8" HorizontalAlignment="Stretch">
|
||||||
<StackPanel Orientation="Horizontal">
|
<Grid>
|
||||||
<Button Name="LaunchServerButton">Launch server</Button>
|
<Grid.ColumnDefinitions>
|
||||||
<Button Name="LaunchPcAdminButton">Launch PC admin</Button>
|
<ColumnDefinition />
|
||||||
<Button Name="InstallVrClientButton">Install VR client</Button>
|
<ColumnDefinition />
|
||||||
<Button Name="InstallAndroidAdminButton">Install Android admin</Button>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Name="DeleteButton">Delete</Button>
|
<StackPanel Grid.Column="0" Orientation="Vertical">
|
||||||
</StackPanel>
|
<Label Content="{Binding Id, StringFormat='ID: {0}'}" />
|
||||||
|
<Label Content="{Binding InstalledAt, StringFormat='Installed: {0}'}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||||
|
<Button Name="LaunchServerButton" Click="OnLaunchServerClick">Launch server</Button>
|
||||||
|
<Button Name="LaunchPcAdminButton" Click="OnLaunchAdminClick">Launch PC admin</Button>
|
||||||
|
<Button Name="InstallVrClientButton">Install VR client</Button>
|
||||||
|
<Button Name="InstallAndroidAdminButton">Install Android admin</Button>
|
||||||
|
<Button Name="DeleteButton" Click="OnDeleteInstallationClick">Delete</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<DockPanel Grid.Row="2">
|
||||||
|
<Label Name="VersionLabel" HorizontalAlignment="Right" />
|
||||||
|
</DockPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using MetaforceInstaller.Core.Intefaces;
|
using MetaforceInstaller.Core.Intefaces;
|
||||||
|
using MetaforceInstaller.Core.Models;
|
||||||
using MetaforceInstaller.Core.Services;
|
using MetaforceInstaller.Core.Services;
|
||||||
using MetaforceInstaller.UI.ViewModels;
|
using MetaforceInstaller.UI.ViewModels;
|
||||||
|
|
||||||
|
|
@ -19,6 +23,9 @@ public partial class MainWindow : Window
|
||||||
_storageService = new StorageService();
|
_storageService = new StorageService();
|
||||||
DataContext = _viewModel;
|
DataContext = _viewModel;
|
||||||
|
|
||||||
|
VersionLabel.Content = Assembly.GetExecutingAssembly()
|
||||||
|
.GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version;
|
||||||
|
|
||||||
NewInstallationButton.Click += OnNewInstalltionClick;
|
NewInstallationButton.Click += OnNewInstalltionClick;
|
||||||
|
|
||||||
LoadInstallations();
|
LoadInstallations();
|
||||||
|
|
@ -36,4 +43,41 @@ public partial class MainWindow : Window
|
||||||
await newInstallationDialog.ShowDialog<NewInstallationDialog>(this);
|
await newInstallationDialog.ShowDialog<NewInstallationDialog>(this);
|
||||||
LoadInstallations();
|
LoadInstallations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async void OnDeleteInstallationClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Button button && button.DataContext is InstallationData installationData)
|
||||||
|
{
|
||||||
|
var name = installationData.Title;
|
||||||
|
Console.WriteLine($"Delete {name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void OnLaunchServerClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Button button && button.DataContext is InstallationData installationData)
|
||||||
|
{
|
||||||
|
var exePath = installationData.Parts.WindowsServerPath;
|
||||||
|
var processInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = exePath,
|
||||||
|
UseShellExecute = false,
|
||||||
|
};
|
||||||
|
Process.Start(processInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void OnLaunchAdminClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Button button && button.DataContext is InstallationData installationData)
|
||||||
|
{
|
||||||
|
var exePath = installationData.Parts.WindowsAdminPath;
|
||||||
|
var processInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = exePath,
|
||||||
|
UseShellExecute = false,
|
||||||
|
};
|
||||||
|
Process.Start(processInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue