@@ -1,11 +1,77 @@ | |||||
using HKCardIN.ViewModels; | |||||
using HandyControl.Controls; | |||||
using HKCardIN.ViewModels; | |||||
using Stylet; | using Stylet; | ||||
using StyletIoC; | |||||
using System; | using System; | ||||
using System.Configuration; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Threading; | |||||
using System.Windows; | |||||
namespace HKCardIN | namespace HKCardIN | ||||
{ | { | ||||
public class Bootstrapper : Bootstrapper<RootViewModel> | public class Bootstrapper : Bootstrapper<RootViewModel> | ||||
{ | { | ||||
/// <summary> | |||||
/// 程序启动 | |||||
/// </summary> | |||||
protected override void OnStart() | |||||
{ | |||||
} | |||||
protected override void ConfigureIoC(IStyletIoCBuilder builder) | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// 初始化系统相关参数配置 | |||||
/// </summary> | |||||
protected override void Configure() | |||||
{ | |||||
base.Configure(); | |||||
} | |||||
/// <summary> | |||||
/// 初始化VM | |||||
/// </summary> | |||||
protected override void Launch() | |||||
{ | |||||
base.Launch(); | |||||
} | |||||
/// <summary> | |||||
/// 加载首页VM | |||||
/// </summary> | |||||
/// <param name="rootViewModel"></param> | |||||
protected override void DisplayRootView(object rootViewModel) | |||||
{ | |||||
base.DisplayRootView(rootViewModel); | |||||
} | |||||
/// <summary> | |||||
///VM加载完毕 | |||||
/// </summary> | |||||
protected override void OnLaunch() | |||||
{ | |||||
base.OnLaunch(); | |||||
} | |||||
/// <summary> | |||||
/// 退出 | |||||
/// </summary> | |||||
/// <param name="e"></param> | |||||
protected override void OnExit(ExitEventArgs e) | |||||
{ | |||||
base.OnExit(e); | |||||
} | |||||
/// <summary> | |||||
/// 全局异常捕获 | |||||
/// </summary> | |||||
/// <param name="e"></param> | |||||
protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e) | |||||
{ | |||||
GC.Collect(); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,7 +1,8 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>WinExe</OutputType> | <OutputType>WinExe</OutputType> | ||||
<TargetFramework>net5.0-windows</TargetFramework> | |||||
<TargetFramework>net6.0-windows</TargetFramework> | |||||
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages> | |||||
<UseWPF>true</UseWPF> | <UseWPF>true</UseWPF> | ||||
<AssemblyName>HKCardIN</AssemblyName> | <AssemblyName>HKCardIN</AssemblyName> | ||||
<RootNamespace>HKCardIN</RootNamespace> | <RootNamespace>HKCardIN</RootNamespace> | ||||
@@ -17,8 +18,14 @@ | |||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||||
<DefineConstants>TRACE;Core</DefineConstants> | <DefineConstants>TRACE;Core</DefineConstants> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | |||||
<None Remove="HKResouces\头像.png" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="HandyControls" Version="3.4.1" /> | <PackageReference Include="HandyControls" Version="3.4.1" /> | ||||
<PackageReference Include="Stylet" Version="1.3.6" /> | <PackageReference Include="Stylet" Version="1.3.6" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<Resource Include="HKResouces\头像.png" /> | |||||
</ItemGroup> | |||||
</Project> | </Project> |
@@ -2,15 +2,8 @@ | |||||
namespace HKCardIN.ViewModels | namespace HKCardIN.ViewModels | ||||
{ | { | ||||
public class RootViewModel : PropertyChangedBase | |||||
public class RootViewModel : Conductor<IScreen> | |||||
{ | { | ||||
private string _title = "HandyControl Application"; | |||||
public string Title | |||||
{ | |||||
get { return _title; } | |||||
set { SetAndNotify(ref _title, value); } | |||||
} | |||||
public RootViewModel() | public RootViewModel() | ||||
{ | { | ||||
@@ -1,16 +1,108 @@ | |||||
<hc:Window x:Class="HKCardIN.Views.RootView" | |||||
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:viewModels="clr-namespace:HKCardIN.ViewModels" | |||||
xmlns:hc="https://handyorg.github.io/handycontrol" | |||||
mc:Ignorable="d" | |||||
d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}" | |||||
Title="{Binding Title}" | |||||
WindowStartupLocation="CenterScreen" | |||||
ShowTitle="True" | |||||
Height="450" | |||||
Width="800"> | |||||
<TextBlock Text="Hello World" HorizontalAlignment="Center" VerticalAlignment="Center" /> | |||||
<hc:Window | |||||
x:Class="HKCardIN.Views.RootView" | |||||
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:hc="https://handyorg.github.io/handycontrol" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:viewModels="clr-namespace:HKCardIN.ViewModels" | |||||
Title="海科智慧一卡通平台" | |||||
Width="800" | |||||
Height="500" | |||||
d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}" | |||||
ShowMaxButton="False" | |||||
ShowTitle="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
mc:Ignorable="d"> | |||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<StackPanel Margin="0,12,0,0"> | |||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<Border | |||||
Width="100" | |||||
Height="120" | |||||
BorderBrush="BlanchedAlmond" | |||||
BorderThickness="1"> | |||||
<Border.Effect> | |||||
<DropShadowEffect ShadowDepth="1" Color="Black" /> | |||||
</Border.Effect> | |||||
<Image | |||||
Width="100" | |||||
Height="120" | |||||
Source="/HKResouces/头像.png" | |||||
Stretch="UniformToFill" /> | |||||
</Border> | |||||
<StackPanel Grid.Column="1"> | |||||
<WrapPanel> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="姓名:" /> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Foreground="Red" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="李四" /> | |||||
</WrapPanel> | |||||
<WrapPanel Margin="0,20,0,0"> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="手机:" /> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Foreground="Red" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="13812345678" /> | |||||
</WrapPanel> | |||||
<WrapPanel Margin="0,20,0,0"> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="员工号:" /> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Foreground="Red" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="001" /> | |||||
</WrapPanel> | |||||
</StackPanel> | |||||
</Grid> | |||||
<hc:Divider | |||||
Content="卡信息" | |||||
FontSize="16" | |||||
FontWeight="Bold" /> | |||||
<StackPanel Margin="20,0,0,0"> | |||||
<WrapPanel> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="卡号:" /> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Foreground="Red" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="123456" /> | |||||
</WrapPanel> | |||||
<WrapPanel Margin="0,20,0,0"> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="卡上余额:" /> | |||||
<TextBlock | |||||
FontSize="18" | |||||
Foreground="Red" | |||||
Style="{StaticResource TextBlockDefaultBold}" | |||||
Text="123456" /> | |||||
</WrapPanel> | |||||
</StackPanel> | |||||
</StackPanel> | |||||
</Grid> | |||||
</hc:Window> | </hc:Window> |
@@ -1,7 +1,8 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>WinExe</OutputType> | <OutputType>WinExe</OutputType> | ||||
<TargetFramework>net5.0-windows</TargetFramework> | |||||
<TargetFramework>net6.0-windows</TargetFramework> | |||||
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages> | |||||
<UseWPF>true</UseWPF> | <UseWPF>true</UseWPF> | ||||
<AssemblyName>HKCardOUT</AssemblyName> | <AssemblyName>HKCardOUT</AssemblyName> | ||||
<RootNamespace>HKCardOUT</RootNamespace> | <RootNamespace>HKCardOUT</RootNamespace> | ||||