Maui-snppts
[删除(380066935@qq.com或微信通知)]
更好的阅读体验请查看原文:https://github.com/snpptsdev/snppts
snpptsdev/snppts: The Snppts web UI hosted at https://www.snppts.dev (github.com)
欢迎
你好!欢迎来到 Snppts.dev!
如果你在 .NET MAUI 中创建很酷的 UI(或者仍然在 Xamarin 中!),这就是你要去的地方!欢迎您添加您创建的 UI,并成为我们不断增长的内容库的一部分!请记住,您分享的内容不违反社区行为准则。
将自己添加为作者
要将自己添加为 Snppts 作者,您可以分叉此项目,将自己作为类添加到作者文件夹中,实现 IAmAnAuthor
接口。
结果应如下所示:
public class StevenThewissen : IAmAnAuthor
{
public string FirstName => "Steven";
public string LastName => "Thewissen";
public Uri Website => new Uri("https://www.thewissen.io");
public string TwitterHandle => "devnl";
public string GitHubHandle => "sthewissen";
public string EmailAddress => "steven@thewissen.io";
public string GravatarHash => "62ce0e69389e31fd3c42fb230f9b1637";
}
几点提示:
- 使用 PascalCase 以您的名字和姓氏命名类。
“名字
”和“姓氏”
属性应类似于相同的名称。EmailAddress
,TwitterHandle和GitHubHandle
应该很清楚,TwitterHandle
没有前导@。
- 网站属性可以是您的全球
网站
,也可以是您希望人们查看的任何内容。 - 如果你想展示你的头像,去 https://en.gravatar.com/site/check/ 获取你的哈希值!如果您不填写哈希,您将被视为剪影。
添加您的第一个代码段
若要添加代码段,可以分叉此项目,请将代码段作为类添加到 Snippets 文件夹中,从而实现 IAmASnippet
接口。
结果应如下所示:
public class PinBasedLogin : IAmASnippet
{
public string Slug => "pin-based-login";
public string Title => "PIN-based Login";
public GitHubRepoInfo GitHubRepoInfo => new GitHubRepoInfo("snpptsio/Snppts.PinBasedLogin");
public bool ContainsAndroidSample => true;
public bool ContainsiOSSample => true;
public bool ContainsUWPSample => false;
public Sdk BuiltWith => Sdk.Maui;
public string Description => "This snippet was created to demonstrate a simple PIN-based login screen. It uses buttons and images to create the numpad control. Tapping on a number adds the number to a property bound to the interface. Also contains some simple length checks (max. 6 characters) for the PIN code and uses Fresh MVVM for its page models.";
public IAmAnAuthor AuthorInfo => new StevenThewissen();
public IEnumerable<Uri> ImageUris => new List<Uri>
{
new Uri("https://raw.githubusercontent.com/snpptsio/MigratedImages/main/18/60.jpg"),
new Uri("https://raw.githubusercontent.com/snpptsio/MigratedImages/main/18/61.jpg")
};
public IList<Category> Categories => new List<Category>
{
Category.LOGIN
};
}
几点提示:
- 使用 PascalCase 以代码段的标题命名类。
- 提供一个 slug,您的创作应该在 Snppts 上永久链接。
- 通过创建
IAmAnAuthor
对象的新实例来链接该对象。这使您可以在将来发布更多片段! - 为您的创作选择一个或多个适当的类别。如果没有适合您创作的现有类别,您可以添加一个类别,但将在提交 PR 时对其进行审核。
- 使用
ImageUris
,您可以提供一个或多个 URI,展示您创建的屏幕截图。请确保这些屏幕截图都是单个屏幕的,因此没有编译。
请只是.NET MAUI和Xamarin。
这个网站是专门针对.NET MAUI和Xamarin的,所以Swift、Java、Objective-C等样本将不被接受。由于我们将查看每个 PR,因此我们将拒绝任何与 .NET MAUI 或 Xamarin 无关的 PR。
最后一步...
这确实是猴子的一大步
不要忘记在您的博客上加入 Snppts 精选徽章并链接回我们!享受我们所有的精彩内容!当然,也非常欢迎您提交其他功能和错误修复。