1 Star 0 Fork 4

哈喽/仿朝夕教育WPF课程管理系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainWindow.xaml 16.76 KB
一键复制 编辑 原始数据 按行查看 历史
flashcjy 提交于 2024-04-03 20:08 . no commit message
<Window x:Class="WpfApp001.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp001"
xmlns:converter="clr-namespace:WpfApp001.Converter"
mc:Ignorable="d" Name="LoginWindow"
Title="登录窗体" Height="800" Width="1280"
FontFamily="Microsoft YaHei" FontWeight="ExtraLight"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
WindowStyle="None" AllowsTransparency="True" Background="{x:Null}" MouseDoubleClick="LoginWindow_MouseDoubleClick"
>
<Window.Resources>
<converter:GenderConverter x:Key="genderConverter"></converter:GenderConverter>
<Style TargetType="RadioButton" x:Key="NavButtonStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Background="Transparent" CornerRadius="8" Height="30" Margin="10,0" Name="back" Cursor="Hand">
<ContentControl Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15,5"></ContentControl>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44ffffff"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
<ControlTemplate TargetType="{x:Type TextBox}" x:Key="SearchTextBoxTemplate">
<Border CornerRadius="5" x:Name="border" BorderBrush="White" Background="White" BorderThickness="1" SnapsToDevicePixels="True" Opacity="0.3" VerticalAlignment="Center" Cursor="Hand">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xeafe;" FontFamily="assets/fonts/#iconfont" Foreground="red" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<TextBlock Grid.Column="1" VerticalAlignment="Center" Text="请输入搜索条件.." x:Name="mt" Visibility="Visible" Padding="0,6" />
<ScrollViewer Grid.Column="1" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalContentAlignment="Center" Padding="0,6"
FontSize="14" Margin="5" Foreground="Black" Background="Transparent"
/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="mt" Property="Visibility" Value="Hidden"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--动画-->
<Storyboard x:Key="OpenUserInfoStoryboard">
<DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetName="tt" Storyboard.TargetProperty="X"></DoubleAnimation>
</Storyboard>
<Storyboard x:Key="CloseUserInfoStoryboard">
<DoubleAnimation Duration="0:0:0.2" To="250" Storyboard.TargetName="tt" Storyboard.TargetProperty="X"></DoubleAnimation>
</Storyboard>
<ControlTemplate TargetType="RadioButton" x:Key="GenderRadioButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Width="14" Height="14" BorderThickness="1" BorderBrush="#007DFA" CornerRadius="7" VerticalAlignment="Center" Background="White" HorizontalAlignment="Center" Margin="0,0,0,6" Cursor="Hand">
<Border Width="8" Height="8" CornerRadius="4" Background="#007DFA" Margin="0" Name="point" Visibility="Hidden" ></Border>
</Border>
<ContentControl Grid.Column="1" Foreground="White" Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="6,0,20,6"></ContentControl>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="point"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="Button.Click" SourceName="btnUserInfo">
<BeginStoryboard Storyboard="{StaticResource OpenUserInfoStoryboard}"></BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Button.Click" SourceName="btnCloseOfUserInfo">
<BeginStoryboard Storyboard="{StaticResource CloseUserInfoStoryboard}"></BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<Border Margin="5" Background="White" CornerRadius="10" MouseLeftButtonDown="Border_MouseLeftButtonDown">
<Grid>
<Border Background="#007DFA" Height="200" VerticalAlignment="Top" CornerRadius="5,5,0,0"></Border>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,4,0">
<Button Content="&#xe624;" Style="{StaticResource OperateBtnStyle}" Click="btnMin_Click"></Button>
<Button Content="&#xe600;" Style="{StaticResource OperateBtnStyle}" Click="btnMax_Click"></Button>
<Button Content="&#xe601;" Style="{StaticResource OperateBtnStyle}" Background="DarkRed" Click="btnClose_Click"></Button>
</StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="68"></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0" Grid.Row="0">
<Image Source="/Resource/Images/Logo.png" Width="50" Height="50" />
<StackPanel>
<TextBlock Text="朝夕教育管理平台" FontSize="20" Foreground="White" Margin="5"></TextBlock>
<TextBlock Text="创造美好生活" FontSize="12" Foreground="#ccc" Margin="10,0,0,0"></TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="2">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,150,0">
<Image Source="{Binding UserInfo.Avatar}" Width="40" HorizontalAlignment="Right">
<Image.Clip>
<RectangleGeometry RadiusX="20" RadiusY="20" Rect="0,0,40,40"/>
</Image.Clip>
</Image>
<Button Background="Transparent" BorderThickness="0" Name="btnUserInfo">
<Button.Template>
<ControlTemplate TargetType="Button">
<TextBlock Text="{Binding UserInfo.UserName}" VerticalAlignment="Center" Margin="10,0" Cursor="Hand"
FontSize="14" />
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,0,0,0">
<RadioButton Content="首页" Style="{StaticResource NavButtonStyle}" IsChecked="True" Command="{Binding NavChangeCommand}" CommandParameter="Home"></RadioButton>
<RadioButton Content="关于我们" Style="{StaticResource NavButtonStyle}" Command="{Binding NavChangeCommand}" CommandParameter="About"></RadioButton>
<RadioButton Content="课程中心" Style="{StaticResource NavButtonStyle}" Command="{Binding NavChangeCommand}" CommandParameter="Courses"></RadioButton>
<RadioButton Content="诚聘英才" Style="{StaticResource NavButtonStyle}" Command="{Binding NavChangeCommand}" CommandParameter="JoinUs"></RadioButton>
<RadioButton Content="个人中心" Style="{StaticResource NavButtonStyle}" Command="{Binding NavChangeCommand}" CommandParameter="UserCenter"></RadioButton>
</StackPanel>
<TextBox Template="{DynamicResource SearchTextBoxTemplate}" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="300" Height="32" Margin="0,0,20,0" Background="#44ffffff" Text="{Binding SearchText}">
</TextBox>
<ScrollViewer Grid.Row="2" Content="{Binding MainContent}" VerticalScrollBarVisibility="Auto"></ScrollViewer>
</Grid>
<Border Background="#ee444444" Width="240" HorizontalAlignment="Right" CornerRadius="0,5,5,0" BorderBrush="White">
<Border.RenderTransform>
<TranslateTransform X="250" x:Name="tt"></TranslateTransform>
</Border.RenderTransform>
<StackPanel Orientation="Vertical">
<Button Content="&#xe601;" Style="{StaticResource OperateBtnStyle}" Cursor="Hand" Background="White" Opacity="0.5" FontSize="16" x:Name="btnCloseOfUserInfo" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Black"></Button>
<StackPanel Margin="0 20 0 0">
<Image Source="{Binding UserInfo.Avatar}" Width="100" Height="100" VerticalAlignment="Top" HorizontalAlignment="Center">
<Image.Clip>
<RectangleGeometry RadiusX="50" RadiusY="50" Rect="0,0,100,100"/>
</Image.Clip>
</Image>
</StackPanel>
<StackPanel Margin="10,20,10,0" Orientation="Vertical">
<StackPanel.Resources>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"></Setter>
</Style>
<Style TargetType="TextBox">
<Setter Property="Foreground" Value="White"></Setter>
</Style>
<Style TargetType="Border">
<Setter Property="BorderThickness" Value="0,0,0,1"></Setter>
<Setter Property="BorderBrush" Value="White"></Setter>
<Setter Property="Margin" Value="0,10,0,0"></Setter>
</Style>
</StackPanel.Resources>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="用 户 名:" Width="70" FontSize="14"></TextBlock>
<TextBlock Text="{Binding UserInfo.UserName}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</Border>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="联系电话:" Width="70" FontSize="14"></TextBlock>
<TextBlock Text="{Binding UserInfo.Tel}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</Border>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="邮 箱:" Width="70" FontSize="14"></TextBlock>
<TextBlock Text="{Binding UserInfo.Email}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</Border>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="部 门:" Width="70" FontSize="14"></TextBlock>
<TextBlock Text="{Binding UserInfo.DepartmentName}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</Border>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="职 称:" Width="70" FontSize="14"></TextBlock>
<TextBlock Text="{Binding UserInfo.PositionName}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</Border>
<Border>
<StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="性 别:" Width="70" FontSize="14"></TextBlock>
<RadioButton Content="男" Template="{StaticResource GenderRadioButtonTemplate }" Margin="10,0,0,0" IsChecked="{Binding UserInfo.Sex,Converter={StaticResource genderConverter},ConverterParameter=1}"></RadioButton>
<RadioButton Content="女" Template="{StaticResource GenderRadioButtonTemplate }" Margin="10,0,0,0" IsChecked="{Binding UserInfo.Sex,Converter={StaticResource genderConverter},ConverterParameter=2}"></RadioButton>
</StackPanel>
</Border>
<Border BorderThickness="0">
<StackPanel Orientation="Vertical" Height="30">
<TextBlock Text="个性签名:" Width="70" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
</StackPanel>
</Border>
<TextBlock Height="128" TextWrapping="WrapWithOverflow" Text="{Binding UserInfo.Signature}" HorizontalAlignment="Left" Margin="10,0" FontSize="14" Background="Transparent"></TextBlock>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Border>
</Window>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/lovemygirlkk99/zhaoxi-CourseManagement.git
git@gitee.com:lovemygirlkk99/zhaoxi-CourseManagement.git
lovemygirlkk99
zhaoxi-CourseManagement
仿朝夕教育WPF课程管理系统
master

搜索帮助