Skip to content

Commit 14d7108

Browse files
committed
v5.0
1 parent af00ad2 commit 14d7108

14 files changed

+620
-636
lines changed

.editorconfig

Lines changed: 0 additions & 123 deletions
This file was deleted.

Electrical Weathering.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@ EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|x64 = Debug|x64
11-
Debug|x86 = Debug|x86
1211
Release|x64 = Release|x64
13-
Release|x86 = Release|x86
1412
EndGlobalSection
1513
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1614
{8A23BF79-FD70-4942-85F3-61839911616F}.Debug|x64.ActiveCfg = Debug|Any CPU
17-
{8A23BF79-FD70-4942-85F3-61839911616F}.Debug|x64.Build.0 = Debug|Any CPU
18-
{8A23BF79-FD70-4942-85F3-61839911616F}.Debug|x86.ActiveCfg = Debug|Any CPU
19-
{8A23BF79-FD70-4942-85F3-61839911616F}.Debug|x86.Build.0 = Debug|Any CPU
2015
{8A23BF79-FD70-4942-85F3-61839911616F}.Release|x64.ActiveCfg = Release|Any CPU
2116
{8A23BF79-FD70-4942-85F3-61839911616F}.Release|x64.Build.0 = Release|Any CPU
22-
{8A23BF79-FD70-4942-85F3-61839911616F}.Release|x86.ActiveCfg = Release|x86
23-
{8A23BF79-FD70-4942-85F3-61839911616F}.Release|x86.Build.0 = Release|x86
2417
EndGlobalSection
2518
GlobalSection(SolutionProperties) = preSolution
2619
HideSolutionNode = FALSE

Electrical Weathering/App.xaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<Application x:Class="Electrical_Weathering.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
StartupUri="MainWindow.xaml">
3+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
55
<Application.Resources>
6+
<ResourceDictionary>
7+
<ResourceDictionary.MergedDictionaries>
8+
<ui:ThemesDictionary Theme="Dark" />
9+
<ui:ControlsDictionary />
10+
</ResourceDictionary.MergedDictionaries>
11+
</ResourceDictionary>
612
</Application.Resources>
713
</Application>

Electrical Weathering/App.xaml.cs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.Windows;
1+
using Microsoft.Extensions.DependencyInjection;
2+
using System;
3+
using System.Windows;
24

35
namespace Electrical_Weathering
46
{
@@ -7,5 +9,33 @@ namespace Electrical_Weathering
79
/// </summary>
810
public partial class App : Application
911
{
12+
private IServiceProvider _serviceProvider;
13+
14+
protected override void OnStartup(StartupEventArgs e)
15+
{
16+
base.OnStartup(e);
17+
var services = new ServiceCollection();
18+
ConfigureServices(services);
19+
_serviceProvider = services.BuildServiceProvider();
20+
var mainWindow = _serviceProvider.GetRequiredService<MainWindow>();
21+
mainWindow.Show();
22+
}
23+
24+
private void ConfigureServices(IServiceCollection services)
25+
{
26+
services.AddSingleton<WeatheringMachine>();
27+
services.AddSingleton<MainWindowViewModel>();
28+
services.AddSingleton<MainWindow>();
29+
}
30+
31+
protected override void OnExit(ExitEventArgs e)
32+
{
33+
if (_serviceProvider is IDisposable disposable)
34+
{
35+
disposable.Dispose();
36+
}
37+
38+
base.OnExit(e);
39+
}
1040
}
1141
}
Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,36 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
3+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
44
<OutputType>WinExe</OutputType>
5-
<IsWebBootstrapper>false</IsWebBootstrapper>
6-
<PublishUrl>publish\</PublishUrl>
7-
<Install>true</Install>
8-
<InstallFrom>Disk</InstallFrom>
9-
<UpdateEnabled>false</UpdateEnabled>
10-
<UpdateMode>Foreground</UpdateMode>
11-
<UpdateInterval>7</UpdateInterval>
12-
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
13-
<UpdatePeriodically>false</UpdatePeriodically>
14-
<UpdateRequired>false</UpdateRequired>
155
<MapFileExtensions>true</MapFileExtensions>
16-
<VersionPrefix>4.1.0.0</VersionPrefix>
17-
<ApplicationRevision>0</ApplicationRevision>
18-
<ApplicationVersion>4.1.0.%2a</ApplicationVersion>
19-
<UseApplicationTrust>false</UseApplicationTrust>
20-
<BootstrapperEnabled>true</BootstrapperEnabled>
21-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<ApplicationVersion>5.0.0</ApplicationVersion>
227
<UseWPF>true</UseWPF>
238
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
24-
<PlatformTarget>x64</PlatformTarget>
259
<SatelliteResourceLanguages>zh-Hans</SatelliteResourceLanguages>
2610
<Platforms>AnyCPU</Platforms>
2711
<ApplicationManifest>app.manifest</ApplicationManifest>
2812
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
2913
<DebugType>full</DebugType>
30-
<AssemblyVersion></AssemblyVersion>
31-
<FileVersion></FileVersion>
14+
<Authors>[email protected]</Authors>
15+
<Copyright>Copyright © 2017-2023 ZNH Industry™</Copyright>
3216
<NeutralLanguage>zh-CN</NeutralLanguage>
3317
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3418
</PropertyGroup>
3519

3620
<PropertyGroup>
3721
<ApplicationIcon>AppIcon.ico</ApplicationIcon>
22+
<Version>$(ApplicationVersion)</Version>
3823
</PropertyGroup>
3924

4025
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
41-
<OutputPath>bin\x64\Debug\</OutputPath>
26+
<OutputPath>bin\Debug\</OutputPath>
4227
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4328
</PropertyGroup>
4429

4530
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
46-
<OutputPath>bin\x64\Release\</OutputPath>
31+
<OutputPath>bin\Release\</OutputPath>
4732
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4833
</PropertyGroup>
49-
50-
<ItemGroup>
51-
<None Remove="Resources\Test.bmp" />
52-
</ItemGroup>
5334

5435
<ItemGroup>
5536
<Resource Include="AppIcon.ico" />
@@ -71,10 +52,12 @@
7152
</ItemGroup>
7253

7354
<ItemGroup>
55+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
7456
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
75-
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.7.0.20230115" />
76-
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.7.0.20230115" />
77-
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
78-
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
57+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
58+
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
59+
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.8.0.20230708" />
60+
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.8.0.20230708" />
61+
<PackageReference Include="WPF-UI" Version="3.0.0-preview.9" />
7962
</ItemGroup>
8063
</Project>

0 commit comments

Comments
 (0)