Skip to content

Commit

Permalink
Support WPF on .net core 3.1 and .net framework (aduskin#6)
Browse files Browse the repository at this point in the history
* add vlc bin packages

* move to src folder

* move sln to root folder

* 从 asp.net core 获取最新的 mimeType

* 修改readme 里面 的 libVlc 依赖项

* 修复拼音筛选

* changeback to orginal sln

* add .editorconfig

* 解决就文件引用冲突

* * => #
  • Loading branch information
John0King authored Apr 6, 2020
1 parent af66ff6 commit d4e0f7c
Show file tree
Hide file tree
Showing 17 changed files with 1,279 additions and 892 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[*]
indent_style = space
indent_size = 3
charset = utf-8

[.csproj]
indent_size = 4

[.md]
indent_size = 4
50 changes: 50 additions & 0 deletions AduSkin.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{943343AA-6C6F-46CB-BC3A-E4CFF7B7BE23}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AduSkin", "src\AduSkin\AduSkin.csproj", "{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AduVideoPlayer", "src\AduVideoPlayer\AduVideoPlayer.csproj", "{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AduSkin.Demo", "src\AduSkin.Demo\AduSkin.Demo.csproj", "{9569B8A3-5935-4D83-8AF2-519D5E666E82}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{95C4AEA1-D2C0-4939-AA50-82E1116B9DFA}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1}.Release|Any CPU.Build.0 = Release|Any CPU
{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76}.Release|Any CPU.Build.0 = Release|Any CPU
{9569B8A3-5935-4D83-8AF2-519D5E666E82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9569B8A3-5935-4D83-8AF2-519D5E666E82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9569B8A3-5935-4D83-8AF2-519D5E666E82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9569B8A3-5935-4D83-8AF2-519D5E666E82}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1703A7C5-7E70-4DF7-AC0D-63CBCCCFB4A1} = {943343AA-6C6F-46CB-BC3A-E4CFF7B7BE23}
{EC2AAD8D-FDA7-4EE5-940D-440EE7B86A76} = {943343AA-6C6F-46CB-BC3A-E4CFF7B7BE23}
{9569B8A3-5935-4D83-8AF2-519D5E666E82} = {943343AA-6C6F-46CB-BC3A-E4CFF7B7BE23}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {37AF0C02-BAB7-47D1-8CBD-682128501D0D}
EndGlobalSection
EndGlobal
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ xmlns:AduSkin="clr-namespace:AduSkin.Controls.Metro;assembly=AduSkin"
<AduSkin:MetroWindow x:Class="MainWindow"/>
//使用控件
<AduSkin:AduFlatButton Content="按钮"/>

```
**视频控件需要依赖[VideoLan.LibVlc.Windows]https://www.nuget.org/packages/VideoLAN.LibVLC.Windows/)**


**视频控件 需要依赖 [VideoLan.LibVlc.Windows](https://www.nuget.org/packages/VideoLAN.LibVLC.Windows/)**
```
//使用.net cli
dotnet添加程序包VideoLan.LibVlc.Windows
//使用vs的package-manager
安装包VideoLAN.LibVLC.Windows
// 使用 .net cli
dotnet add package VideoLan.LibVlc.Windows
// 使用 vs 的 package-manager
Install-Package VideoLAN.LibVLC.Windows
```

# 开发案例如下
Expand Down
12 changes: 8 additions & 4 deletions src/AduSkin.Demo/AduSkin.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net45</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net45;net46</TargetFrameworks>
<GenerateDocumentFile>true</GenerateDocumentFile>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
Expand All @@ -9,7 +9,7 @@
<OutputType>WinExe</OutputType>
<StartupObject />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AduSkin\AduSkin.csproj" />
<ProjectReference Include="..\AduVideoPlayer\AduVideoPlayer.csproj" />
Expand All @@ -18,13 +18,17 @@
<ItemGroup>
<PackageReference Include="CommonServiceLocator" Version="2.0.5" />
<PackageReference Include="MvvmLightLibs" Version="5.4.1.1" />
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.8.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
</ItemGroup>


<ItemGroup>
<Resource Include="Resources/**" />
<Resource Include="logo.ico" />
<Resource Include="logo.png" />
</ItemGroup>

</Project>
</Project>
10 changes: 9 additions & 1 deletion src/AduSkin.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
using AduSkin.Controls.Metro;
using AduSkin.Controls.Metro;
using System.Windows;

namespace AduSkin.Demo
{
public partial class App : Application
{
public App()
{
#if !NET45
// start from net46 , you need to register text encoding provider first to use it!
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
#endif
}

protected override void OnStartup(StartupEventArgs e)
{
var splashScreen = new SplashScreen("Resources/aduskin.png");
Expand Down
10 changes: 9 additions & 1 deletion src/AduSkin.Demo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
using System.Windows;

[assembly: ThemeInfo(ResourceDictionaryLocation.None,ResourceDictionaryLocation.SourceAssembly)]

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(当资源未在页面
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(当资源未在页面
//、应用程序或任何主题专用资源字典中找到时使用)
)]
50 changes: 0 additions & 50 deletions src/AduSkin.sln

This file was deleted.

6 changes: 3 additions & 3 deletions src/AduSkin/AduSkin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<ItemGroup>
<PackageReference Include="System.Management" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net45'">
<Reference Include="System.Web" />
</ItemGroup>

<ItemGroup>
<Resource Include="Resources/**" />
</ItemGroup>

</Project>
</Project>
18 changes: 0 additions & 18 deletions src/AduSkin/AduSkin.nuspec

This file was deleted.

9 changes: 8 additions & 1 deletion src/AduSkin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
using System.Windows;

[assembly:ThemeInfo(ResourceDictionaryLocation.None,ResourceDictionaryLocation.SourceAssembly)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(当资源未在页面
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(当资源未在页面
//、应用程序或任何主题专用资源字典中找到时使用)
)]
Loading

0 comments on commit d4e0f7c

Please sign in to comment.