89 lines
4.5 KiB
XML
89 lines
4.5 KiB
XML
<Window x:Class="YwxApp.AiChat.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
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"
|
|
xmlns:behaviors="clr-namespace:YwxApp.AiChat.Commands"
|
|
xmlns:ViewModels="clr-namespace:YwxApp.AiChat.ViewModels"
|
|
mc:Ignorable="d"
|
|
WindowStartupLocation="CenterScreen"
|
|
Title="ChatAI" Height="600" Width="800" MinHeight="600" MinWidth="800">
|
|
<Window.DataContext>
|
|
<ViewModels:MainViewModel/>
|
|
</Window.DataContext>
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="Views/Style/ButtonStyle.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
<i:Interaction.Behaviors>
|
|
<behaviors:ClosingWindowBehavior Command="{Binding ClosingWindowCommand}" />
|
|
</i:Interaction.Behaviors>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="20"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="10"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="25"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
|
|
<Rectangle >
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Color="#916CE5" Offset="0.5" />
|
|
<GradientStop Color="#FFFFFF" Offset="1.5" />
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Grid.Column="0" >
|
|
<Rectangle Grid.Row="1" Grid.Column="0">
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Color="#9ABAFF" Offset="0.8" />
|
|
<GradientStop Color="#9ABFAF" Offset="0.3" />
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
<StackPanel Margin="0 0 0 0" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center">
|
|
<Button Command="{Binding SwitchToViewCommand}" CommandParameter="SettingView" Style="{StaticResource IconButtonStyle}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Resources/setting64.png" Margin="5" />
|
|
<TextBlock Text="设置" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Command="{Binding SwitchToViewCommand}" CommandParameter="ChatMdView" Style="{StaticResource IconButtonStyle}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Resources/chat64.png" Margin="5"/>
|
|
<TextBlock Text="会话" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Grid.Column="1" Margin="5">
|
|
<ContentControl Content="{Binding CurrentView}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
|
|
</Grid>
|
|
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
|
|
<Rectangle>
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Color="#FAAFA9" Offset="0.1" />
|
|
<GradientStop Color="#A4D3A2" Offset="0.9" />
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle >
|
|
<WrapPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Right">
|
|
<Label Content="{Binding CurrentModel}" Width="auto" FontSize="12" Margin="5 0 5 0"/>
|
|
<Label Content="{Binding CurrentTime}" Background="#00F0BD" Width="auto" FontSize="12" Margin="5 0 5 0"/>
|
|
</WrapPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|