Files
YwxApp.AiChat/Views/SettingView.xaml
2025-03-12 20:02:52 +08:00

58 lines
3.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl x:Class="YwxApp.AiChat.Views.SettingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<UserControl.Resources>
<ResourceDictionary>
<!--Resource dictionary : add the control style-->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Style/ButtonStyle.xaml"/>
<ResourceDictionary Source="Style/TextBoxStyle.xaml"/>
<ResourceDictionary Source="Style/LabelStyle.xaml"/>
<ResourceDictionary Source="Style/ComboBoxStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="#FFFFFF" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- The first line -->
<WrapPanel Grid.Row="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left">
<Label Content="Ollama路径:" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" />
<TextBox x:Name="Tbx_OllamaAppPath" FontSize="12"
Text="{Binding OllamaAppPath}"
Style="{StaticResource SearchBoxStyle}" Margin="5" />
</WrapPanel>
<!--The second line-->
<WrapPanel Grid.Row="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left">
<Label Content="Ollama" VerticalAlignment="Center" Margin="5" />
<Label Name="Label_State" Style="{StaticResource RoundLabelStyle}" />
<Button Content="打开" Style="{StaticResource RoundCornerButtonStyle}"
Command="{Binding StartOllamaServerCommand}"/>
</WrapPanel>
<!--The third line-->
<WrapPanel Grid.Row="2" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left">
<Label Content="模型:" VerticalAlignment="Center" Margin="5" />
<ComboBox x:Name="Cbx_ModelList" Style="{StaticResource RoundComboBoxStyle}"
ItemsSource="{Binding ModelList}"
SelectedItem="{Binding SelectedModel}">
</ComboBox>
<Button Content="刷新" Margin="5" Grid.Row="1"
Style="{StaticResource RoundCornerButtonStyle}"
Command="{Binding ModelListUpdateCommand}"/>
</WrapPanel>
<TextBox x:Name="ModelDesciption" Grid.Row="3" IsReadOnly="True"
TextWrapping="WrapWithOverflow" Text="{Binding ModelInformation,Mode=OneWay}"/>
</Grid>
</UserControl>