重写设置窗口
This commit is contained in:
130
MainWindow.xaml
130
MainWindow.xaml
@@ -6,6 +6,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:behaviors="clr-namespace:YwxApp.AiChat.Commands"
|
||||
xmlns:ViewModels="clr-namespace:YwxApp.AiChat.ViewModels"
|
||||
xmlns:ValueConverter="clr-namespace:YwxApp.AiChat.ValueConverter"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="ChatAI" Height="600" Width="800" MinHeight="600" MinWidth="800">
|
||||
@@ -14,75 +15,74 @@
|
||||
</Window.DataContext>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ValueConverter:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Views/Style/ButtonStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<i:Interaction.Behaviors>
|
||||
</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>
|
||||
</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" >
|
||||
<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="0">
|
||||
<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"/>
|
||||
<Button Content="设置" Command="{Binding OpenSettingWindowCommand}"/>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user