You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
4.6 KiB
112 lines
4.6 KiB
<controls:UserControlBase |
|
x:Class="StabilityMatrix.Avalonia.Views.LaunchPageView" |
|
xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:avaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit" |
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core" |
|
xmlns:ui="using:FluentAvalonia.UI.Controls" |
|
xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels" |
|
d:DataContext="{x:Static mocks:DesignData.LaunchPageViewModel}" |
|
d:DesignHeight="450" |
|
d:DesignWidth="700" |
|
x:CompileBindings="True" |
|
x:DataType="vm:LaunchPageViewModel" |
|
mc:Ignorable="d"> |
|
|
|
<Grid RowDefinitions="Auto,*,Auto"> |
|
<Grid ColumnDefinitions="Auto,*" |
|
Margin="0,8,0, 8"> |
|
<Grid ColumnDefinitions="0.8*,0.2*"> |
|
<Button |
|
Grid.Row="0" |
|
Grid.Column="0" |
|
Width="72" |
|
Margin="16,8,0,0" |
|
HorizontalAlignment="Left" |
|
VerticalAlignment="Stretch" |
|
Classes="success" |
|
Command="{Binding LaunchCommand}" |
|
Content="Launch" /> |
|
<Button |
|
Grid.Row="0" |
|
Grid.Column="0" |
|
Width="72" |
|
Margin="16,8,0,0" |
|
HorizontalAlignment="Left" |
|
VerticalAlignment="Stretch" |
|
Classes="danger" |
|
Command="{Binding Stop}" |
|
Content="Stop" |
|
IsVisible="{Binding RunningPackage, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|
<Button |
|
Grid.Row="0" |
|
Grid.Column="1" |
|
Width="48" |
|
Margin="8,8,0,0" |
|
HorizontalAlignment="Left" |
|
VerticalAlignment="Stretch" |
|
FontSize="16"> |
|
<ui:SymbolIcon FontSize="16" Symbol="Settings" /> |
|
</Button> |
|
</Grid> |
|
|
|
<ComboBox |
|
x:Name="SelectPackageComboBox" |
|
Grid.Row="0" |
|
Grid.Column="1" |
|
Margin="8,8,16,0" |
|
HorizontalAlignment="Stretch" |
|
VerticalAlignment="Top" |
|
ItemsSource="{Binding InstalledPackages}" |
|
SelectedValue="{Binding SelectedPackage}"> |
|
<ComboBox.Styles> |
|
<Style Selector="ComboBox /template/ ContentControl#ContentPresenter > StackPanel > TextBlock:nth-child(2)"> |
|
<Setter Property="IsVisible" Value="False" /> |
|
</Style> |
|
</ComboBox.Styles> |
|
|
|
<ComboBox.ItemTemplate> |
|
<DataTemplate DataType="{x:Type models:InstalledPackage}"> |
|
<StackPanel Margin="10,0,0,0" VerticalAlignment="Top"> |
|
<TextBlock |
|
Name="NameTextBlock" |
|
Margin="0,5,0,5" |
|
Text="{Binding DisplayName, Mode=OneWay}" /> |
|
<TextBlock Text="{Binding FullPath, Mode=OneWay}" /> |
|
</StackPanel> |
|
</DataTemplate> |
|
</ComboBox.ItemTemplate> |
|
</ComboBox> |
|
</Grid> |
|
|
|
<avaloniaEdit:TextEditor |
|
x:Name="Console" |
|
Grid.Row="1" |
|
Margin="8,8,16,10" |
|
Document="{Binding ConsoleDocument}" |
|
FontFamily="Cascadia Code,Consolas,Menlo,Monospace" |
|
IsReadOnly="True" |
|
LineNumbersForeground="DarkSlateGray" |
|
ShowLineNumbers="True" |
|
VerticalScrollBarVisibility="Auto" |
|
WordWrap="True" /> |
|
|
|
<!-- Command="{Binding LaunchWebUiCommand}" --> |
|
<!-- Visibility="{Binding ShowWebUiButton, Converter={StaticResource BoolToVisConverter}}" --> |
|
<Button |
|
Grid.Row="2" |
|
Grid.ColumnSpan="2" |
|
Margin="24,0,24,8" |
|
HorizontalAlignment="Stretch" |
|
Classes="success" |
|
Content="Open Web UI" |
|
Command="{Binding OpenWebUi}" |
|
IsVisible="{Binding ShowWebUiButton}" |
|
FontSize="12" /> |
|
</Grid> |
|
|
|
</controls:UserControlBase>
|
|
|