Files
finder2e_foundry_converter/views/mainwindow.axaml
T

72 lines
3.5 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:finder2e_foundry_converter.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="600"
x:Class="finder2e_foundry_converter.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/assets/avalonia-logo.ico"
Title="Finder2e Foundry Converter"
Width="500" Height="600"
DragDrop.AllowDrop="True">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext at runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainWindowViewModel/>
</Design.DataContext>
<ScrollViewer DragDrop.AllowDrop="True">
<StackPanel Margin="20" Spacing="10" DragDrop.AllowDrop="True">
<Label Content="Provider:"/>
<Grid ColumnDefinitions="*,Auto">
<ComboBox Grid.Column="0" HorizontalAlignment="Stretch"
ItemsSource="{Binding Providers}"
SelectedItem="{Binding SelectedProvider}"/>
<Button Grid.Column="1" Content="Address" Command="{Binding ToggleAddressCommand}" Margin="5,0,0,0"/>
</Grid>
<TextBlock Text="{Binding ErrorText}" Foreground="Red" HorizontalAlignment="Center" IsVisible="{Binding IsErrorVisible}"/>
<StackPanel IsVisible="{Binding IsAddressVisible}" Spacing="5">
<Label Content="{Binding SelectedProvider, StringFormat='{}{0} Address:'}"/>
<TextBox Text="{Binding CurrentAddress}" PlaceholderText="http://localhost:11434"/>
</StackPanel>
<Label Content="Model:"/>
<Grid ColumnDefinitions="*,Auto">
<ComboBox Grid.Column="0" HorizontalAlignment="Stretch"
ItemsSource="{Binding Models}"
SelectedItem="{Binding SelectedModel}"
PlaceholderText="Select Model"/>
<Button Grid.Column="1" Content="Refresh" Command="{Binding RefreshModelsCommand}" Margin="5,0,0,0"/>
</Grid>
<Label Content="Category:"/>
<ComboBox HorizontalAlignment="Stretch"
ItemsSource="{Binding Categories}"
SelectedItem="{Binding SelectedCategory}"/>
<StackPanel IsVisible="{Binding IsNpcSelected}" Spacing="10">
<Label Content="Name:"/>
<TextBox Text="{Binding Name}" PlaceholderText="Enter name..."/>
<Label Content="Level:"/>
<ComboBox HorizontalAlignment="Stretch"
ItemsSource="{Binding Levels}"
SelectedItem="{Binding SelectedLevel}"/>
<Label Content="Description:"/>
<TextBox Text="{Binding Description}" AcceptsReturn="True" Height="100" PlaceholderText="Enter description here..."/>
</StackPanel>
<Button Content="Generate" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
Command="{Binding GenerateCommand}" FontWeight="Bold"/>
<TextBlock Text="{Binding StatusMessage}" TextWrapping="Wrap" Margin="0,10,0,0"/>
</StackPanel>
</ScrollViewer>
</Window>