之前写过挺多的MAUI Sample,其中有很多代码可以打包成组件,当组件完善到一定程度,我会把控件封装起来放到控件库中。
今天,在这个仓库建立一年零八个月后,我觉得可以考虑将其作为开源库发布。
有很多网友在观望.NET MAUI,犹豫是否可以拿来作为有生产力的跨平台移动端开发工具,此时我想告诉大家,.NET MAUI是一个非常不错的移动开发平台。配合 V-Control 来构建移动应用程序,V-Control是适用于.NET MAUI 的组件库(Component),它提供了一组开箱即用的 UI 控件,可快速搭建面向业务的应用程序界面。
dotnet add package VControl
或在NUGET中搜索"V-Control"并安装它。
MauiProgram
使用.UseVControl()
在MauiAppBuilder中添加V-Control的处理程序。public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseVControl() //在这里添加V-Control的处理程序
var mauiApp = builder.Build();
return mauiApp;
}
App.xaml
文件, 在资源中添加
。
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:v="clr-namespace:VControl.Styles;assembly=VControl">
<Application.Resources>
<v:VControlTheme />
...
Application.Resources>
Application>
前往V-Control Docs
您可以前往GitHub查看V-Control的源码和示例。