WeUiSharp
V1.0.10
中文| English
基於WPF 實作的仿Windows 桌面版微信UI 介面庫
An unofficial UI library for Windows WeChat based on WPF implementation
.NET Framework >= 4.7.2
多語言動態切換
主題動態切換(TODO:深色主題)
MIT 協議,開源可商用
建立一個基於.NET Framework 4.7.2+ 的WPF專案(建議使用:Prism 框架,直接使用Prism範本建立專案);
NuGet 安裝WeUiSharp
修改檔案App.xaml
,新增以下資源:
<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>
修改檔案MainWindow.xaml
,將Window
改為weui:Window
,並加入weui
的引用:
<weui:Window xmlns:weui="https://github.com/IUpdatable/WeUiSharp" Title="Hello WeUiSharp"... > <Grid> </Grid> </weui:Window>
修改MainWindow.xaml.cs
,取消從Window 的繼承關係
public partial class MainWindow{public MainWindow(){InitializeComponent();}}
編譯運行,應該可以看到下面效果的介面:
完整程式碼:WeUiSharp.HelloWorld
基於Prism 框架的Hello Wrorld 專案完整程式碼: WeUiSharp.HelloWorldWithPrism
Window
Button
ToggleButton
PathButton
IconButton
Field
CheckBox
ComboBox
MessageBox
ContextMenu
Toast
Alert
MIT