WeUiSharp:基于 WPF 实现的仿 Windows 桌面版微信 UI 界面库
# WeUiSharp基于 WPF 实现的仿 Windows 桌面版微信 UI 界面库
An unofficial UI library for Windows WeChat based on WPF implementation
项目主页:(https://github.com/IUpdatable/WeUiSharp)
## Features
* .NET Framework >= 4.7.2
* 多语言动态切换
* 主题动态切换(TODO:深色主题)
* MIT 协议,开源可商用
## Overview
## Getting Started
1. 创建一个基于.NET Framework 4.7.2+ 的WPF项目(推荐使用:(https://github.com/PrismLibrary/Prism) 框架,直接使用 (https://marketplace.visualstudio.com/items?itemName=BrianLagunas.PrismTemplatePack) 创建项目);
2. NuGet 安装 `WeUiSharp`
3. 修改文件 `App.xaml`,添加以下资源:
```xml
<Application.Resources>
<!-- 下面部分为添加内容 -->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WeUiSharp;component/ControlsResources.xaml"/>
<weui:ThemeResources RequestedTheme="Light">
<weui:ThemeResources.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WeUiSharp;component/ThemeResources/Light.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/WeUiSharp;component/ThemeResources/Dark.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</weui:ThemeResources.ThemeDictionaries>
</weui:ThemeResources>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
```
4. 修改文件 `MainWindow.xaml`,将 `Window` 改为 `weui:Window`,并添加 `weui` 的引用:
```xml
<weui:Window xmlns:weui="https://github.com/IUpdatable/WeUiSharp" Title="Hello WeUiSharp"
...
>
<Grid>
</Grid>
</weui:Window>
```
5. 修改 `MainWindow.xaml.cs`,取消从 Window 的继承关系
```CSharp
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
}
```
6. 编译运行,应该就可以看到下面效果的界面:
完整代码:(https://github.com/IUpdatable/WeUiSharp/tree/master/Src/WeUiSharp.HelloWorld)
基于 Prism 框架的 Hello Wrorld 项目完整代码: (https://github.com/IUpdatable/WeUiSharp/tree/master/Src/WeUiSharp.HelloWorldWithPrism)
## Components
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#Window)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#Button)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#ToggleButton)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#PathButton)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#IconButton)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#Field)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#CheckBox)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#ComboBox)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#MessageBox)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#ContextMenu)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#Toast)
* (https://github.com/IUpdatable/WeUiSharp/wiki/2.-Components#Alert)
虽然看不懂,但是必须支持一下 学习学习 好东西,虽然看不懂,但分享的精神必须点赞,感谢 支持一下厉害
页:
[1]