change - 修改注入方式,添加登录页面、加载效果
parent
524c93f430
commit
3d58397c55
@ -1,18 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SlnMesnac.Repository\SlnMesnac.Repository.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.TouchSocket\SlnMesnac.TouchSocket.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,14 +1,36 @@
|
||||
<Application x:Class="SlnMesnac.WPF.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SlnMesnac.WPF"
|
||||
StartupUri="MainWindow.xaml">
|
||||
xmlns:local="clr-namespace:SlnMesnac.WPF">
|
||||
<Application.Resources>
|
||||
<!--Button样式-->
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Templates/style/resourceStyle.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.LightBlue.xaml" />
|
||||
|
||||
<!--<ResourceDictionary Source="Templates\Languages\StringResource.en-US.xaml" />
|
||||
<ResourceDictionary Source="Templates\Languages\StringResource.zh-CN.xaml" />-->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<!--重写框架主体色-->
|
||||
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#3b76ee" />
|
||||
<SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="#3b76ee" />
|
||||
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#3b76ee" />
|
||||
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#3b76ee" />
|
||||
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#3b76ee" />
|
||||
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#3b76ee" />
|
||||
|
||||
<!-- DataGrid列标题居中样式 -->
|
||||
<Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!-- DataGrid单元格居中样式 -->
|
||||
<Style x:Key="DataGridCellCenterStyle" TargetType="DataGridCell">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
@ -0,0 +1,19 @@
|
||||
<Window x:Class="SlnMesnac.WPF.Page.Loading.LoadingWindow"
|
||||
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:SlnMesnac.WPF.Page.Loading"
|
||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||
mc:Ignorable="d"
|
||||
Height="200" Width="400"
|
||||
WindowStyle="None"
|
||||
ResizeMode="NoResize"
|
||||
Topmost="True"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
Opacity="0.8">
|
||||
<Grid>
|
||||
<Image gif:ImageBehavior.AnimatedSource="pack://application:,,,/Templates/gif/loading.gif" Height="180"/>
|
||||
</Grid>
|
||||
</Window>
|
@ -0,0 +1,58 @@
|
||||
<Window x:Class="SlnMesnac.WPF.Page.Login.LoginWindow"
|
||||
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:SlnMesnac.WPF.Page.Login"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding SystemTitle}" Height="600" Width="980">
|
||||
<Window.Background>
|
||||
<ImageBrush ImageSource="/Templates/image/login-background.jpg" />
|
||||
</Window.Background>
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Background="Transparent" Height="50" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="50,50">
|
||||
<Label Content="{Binding SystemTitle}" Foreground="#007DFA" FontSize="25"/>
|
||||
</StackPanel>
|
||||
<Border Grid.Column="1" Background="White" Height="300" CornerRadius="10" >
|
||||
<Grid Cursor="">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Foreground="Gray" Text="用户登录" FontSize="20"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<!--<TextBlock Foreground="Gray" Text="账号:" FontSize="16" Margin="0,10,10,0"/>
|
||||
<TextBox x:Name="UserNameStr" Foreground="Gray" FontSize="16" Width="150" Height="35"/>-->
|
||||
<materialDesign:PackIcon Kind="AccountKeyOutline" VerticalAlignment="Bottom" Height="25" Width="25" Margin="0,0,10,0"/>
|
||||
<TextBox x:Name="UserNameStr" Width="150" FontSize="16" VerticalAlignment="Center" materialDesign:HintAssist.Hint="请输入用户名" Style="{StaticResource MaterialDesignFloatingHintTextBox}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<!--<TextBlock Foreground="Gray" Text="密码:" FontSize="16" Margin="0,10,10,0"/>-->
|
||||
<!--<PasswordBox x:Name="PasswordStr" HorizontalAlignment="Left" VerticalContentAlignment="Center" Width="150" PasswordChar="*" />-->
|
||||
<materialDesign:PackIcon Kind="AccountLockOutline" VerticalAlignment="Bottom" Height="25" Width="25" Margin="0,0,10,0"/>
|
||||
<PasswordBox
|
||||
x:Name="PasswordStr" Width="150" FontSize="16"
|
||||
materialDesign:HintAssist.Foreground="Green"
|
||||
materialDesign:HintAssist.Hint="请输入密码"
|
||||
materialDesign:TextFieldAssist.UnderlineBrush="Green"
|
||||
Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" Cursor="Hand" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="3">
|
||||
<Button x:Name="LoginBtn" Content="登录" Background="#007DFA" ToolTip="MaterialDesignFlatMidButton" Margin="10,0,10,0" Style="{StaticResource MaterialDesignFlatMidBgButton}" Foreground="White" FontSize="16" Width="150" Height="30" Click="LoginBtn_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
Binary file not shown.
After Width: | Height: | Size: 370 KiB |
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
@ -1,32 +0,0 @@
|
||||
using Serilog;
|
||||
|
||||
namespace SlnMesnac
|
||||
{
|
||||
/// <summary>
|
||||
/// Æô¶¯Àà
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Main·½·¨
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CreateHostBuilder
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSerilog()
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SlnMesnac.Config\SlnMesnac.Config.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Extensions\SlnMesnac.Extensions.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Model\SlnMesnac.Model.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Plc\SlnMesnac.Plc.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Quartz\SlnMesnac.Quartz.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Repository\SlnMesnac.Repository.csproj" />
|
||||
<ProjectReference Include="..\SlnMesnac.Serilog\SlnMesnac.Serilog.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"AppConfig": {
|
||||
"logPath": "E:\\桌面\\日常代码\\SlnMesnac\\SlnMesnac\\bin\\Debug\\net6.0",
|
||||
"mesConnStr": "server=.;uid=sa;pwd=123456;database=JiangYinMENS",
|
||||
"mcsConnStr": "Data Source=175.27.215.92/helowin;User ID=aucma_scada;Password=aucma"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue