blazor

基于 Blazor 开发五子棋⚫⚪小游戏

自作多情 提交于 2020-08-06 00:39:17
今天是农历五月初五,端午节。在此,祝大家端午安康! 端午节是中华民族古老的传统节日之一。端午也称端五,端阳。此外,端午节还有许多别称,如:午日节、重五节、五月节、浴兰节、女儿节、天中节、地腊、诗人节、龙日等。 不好意思,跑题了,就此打住。 事情的经过是这样的,今年端午节公司给每位员工都准备了一个粽子礼盒,本以来就几个粽子而已,没想到今年的粽子礼盒内暗藏玄关,内附一个棋盘和五子棋子。 粽子什么的都不重要,主要是这个五子棋我还挺喜欢的,哈哈哈。😎 正好这段时间用 Blazor 将之前的博客重构了一遍,于是就想着能否用 Blazor 写一个五子棋⚫⚪小游戏呢? 说干就干,本篇主要是分享基于 Blazor 开发的五子棋小游戏,先放试玩地址: https://blazor.meowv.com/gobang 。 大家可以先打开链接让他先加载一会(挂在GitHub,有点慢~🤪),再继续回来看文章哈。 刚开始本来我是自己写的,发现越写越复杂,遂放弃就在Github上寻找有没有实现过类似的需求,别说还真有一位大神用 Blazor 实现了,地址: https://github.com/ut32/gobang/ ,所以我的代码逻辑基本上都参考这位大神的代码。👍👍👍 接下来看看实现过程,新建一个 Gobang.razor razor组件,设置路由: @page "/gobang" 。 我这里直接放在之前

.NET IDE Rider公布2020.2路线图

喜欢而已 提交于 2020-08-05 18:33:02
跨平台 .NET IDE Rider 近日公布了 2020.2 的路线图,介绍了目前正在开发的一些特性,并表示其中一些可能在接下来的版本中出现。主要包括: Windows 上的 .NET Core 后端: Rider 2020.1 已在 macOS 和 Linux 上的 .NET Core 上运行 ReSharper 后端。Windows 方面,后端仍在 .NET Framework 上运行,并使用 NGen 获得启动方面的改进。现在正在将后端也移至 Windows 上的 .NET Core,并准备使用 CrossGen 替代 NGen。 新的 Debugger API: Debugger API 已被大量重写,允许增加更多功能,并且还允许插件加入调试过程,包括自定义值表示形式和改进的惰性值计算,具有更好的中断效果。 Pin-To-Frame: 将扩展 Pin-To-Top 功能以跨帧固定值。在调试递归函数时,这将使我们能够观察不同迭代中值的状态: 数据断点: 每当更改某个属性或字段时,就中断执行,而无需创建多个不同的语句断点。平台限制,目前可能仅适用于 Windows 上的 .NET Core 3+。 重新设计的工具栏: 将使其更简洁,并更易于使用 VCS 集成、运行配置和调试模式等常用功能。同时也可以解决可用性问题,尤其是对于刚加入 Rider 的新用户而言。 彩色工具提示:

基于 abp vNext 和 .NET Core 开发博客项目

人盡茶涼 提交于 2020-08-04 11:52:56
系列文章 基于 abp vNext 和 .NET Core 开发博客项目 - 使用 abp cli 搭建项目 基于 abp vNext 和 .NET Core 开发博客项目 - 给项目瘦身,让它跑起来 基于 abp vNext 和 .NET Core 开发博客项目 - 完善与美化,Swagger登场 基于 abp vNext 和 .NET Core 开发博客项目 - 数据访问和代码优先 基于 abp vNext 和 .NET Core 开发博客项目 - 自定义仓储之增删改查 基于 abp vNext 和 .NET Core 开发博客项目 - 统一规范API,包装返回模型 基于 abp vNext 和 .NET Core 开发博客项目 - 再说Swagger,分组、描述、小绿锁 基于 abp vNext 和 .NET Core 开发博客项目 - 接入GitHub,用JWT保护你的API 基于 abp vNext 和 .NET Core 开发博客项目 - 异常处理和日志记录 基于 abp vNext 和 .NET Core 开发博客项目 - 使用Redis缓存数据 基于 abp vNext 和 .NET Core 开发博客项目 - 集成Hangfire实现定时任务处理 基于 abp vNext 和 .NET Core 开发博客项目 - 用AutoMapper搞定对象映射 基于 abp

Get Current User in a Blazor component

喜夏-厌秋 提交于 2020-08-02 19:12:34
问题 I'm starting a new site with Blazor and Windows Authentication and need to identify the current user viewing the page/component. For a Razor Page, the current user name can be accessed with Context.User.Identity.Name , but that doesn't seem to work in a Blazor component. I've tried injecting HttpContext into the component but the Context is null at runtime. As a bonus, I will eventually want to incorporate this into Startup.cs so I only need to get the username once and can leverage a

Get Current User in a Blazor component

余生颓废 提交于 2020-08-02 19:01:29
问题 I'm starting a new site with Blazor and Windows Authentication and need to identify the current user viewing the page/component. For a Razor Page, the current user name can be accessed with Context.User.Identity.Name , but that doesn't seem to work in a Blazor component. I've tried injecting HttpContext into the component but the Context is null at runtime. As a bonus, I will eventually want to incorporate this into Startup.cs so I only need to get the username once and can leverage a

How to modify the current culture date format in Blazor (server)?

落花浮王杯 提交于 2020-08-02 06:51:07
问题 ASP.NET Core Blazor globalization and localization states: Blazor's @bind functionality performs formats and parses values for display based on the user's current culture. The current culture can be accessed from the System.Globalization.CultureInfo.CurrentCulture property . The statement is true, but the problem is that, the culture has to be set just before it is used (or maybe each time the DOM is refreshed). For demonstration I will use standard blazor counter application. Let's modify

Blazor client-side debugging

ぃ、小莉子 提交于 2020-08-02 06:15:25
问题 I noticed that all of my C# breakpoints do not get hit as debugging seems like its disabled for client-side Blazor apps. Is there a way to attach the debugger or enable the debugger somehow? Thanks 回答1: Update : For those running .NET Core 3.2 preview 3 and above, please refer to this answer For those who like some pictures, here's a step by step using Visual Studio 16.4 preview (.NET Core 3.1 preview 2) & Chrome version 78. Start up the app using a debug profile . E.g. After site loads , and

Blazor client-side debugging

拥有回忆 提交于 2020-08-02 06:15:06
问题 I noticed that all of my C# breakpoints do not get hit as debugging seems like its disabled for client-side Blazor apps. Is there a way to attach the debugger or enable the debugger somehow? Thanks 回答1: Update : For those running .NET Core 3.2 preview 3 and above, please refer to this answer For those who like some pictures, here's a step by step using Visual Studio 16.4 preview (.NET Core 3.1 preview 2) & Chrome version 78. Start up the app using a debug profile . E.g. After site loads , and

How to use Bootstrap modal in Blazor client app?

假如想象 提交于 2020-07-29 06:44:18
问题 I am trying to show bootstrap modal then bind its buttons. But I cannot pass the first step showing the modal. I am using Blazor client template of .net core 3.1. I have a page named Modal.razor which contains the bootstrap modal I found from getbootstrap.com. @if (Show) { <div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Modal title</h5> <button type="button" class="close"

Blazor 修仙之旅

雨燕双飞 提交于 2020-07-29 06:18:40
原文: Blazor 修仙之旅 - Ant Design of Blazor 一.前言 这是《Blazor 修仙之旅》的第三篇,前面两分别是《初次尝试》、《组件与数据绑定》,直接到这里上 Ant Design 确实连不起来,跨度比较大,其实我也是在边学边写,看的是官方文档,我觉得中间这部分重复写博客的意义不大,所以我建议去看官方文档,传送门: 点我 。如果看过我的前两篇,我建议您从这里开始看: 点我 。不用每篇都深刻理解,但需要有一个基本概念。好了,下面进入正题。 二. Ant Design of Blazor 介绍 ant-design-blazor 是国内开发者 ElderJames 创建的一个开源项目。在前不久的微软Build大会也见到了它的身影,受到了微软官方推荐,点赞!顾名思义, ant-design-blazor 是 Ant Design 的 Blazor 实现,开发和服务于企业级后台产品。 ✨ 特性 🌈 提炼自企业级中后台产品的交互语言和视觉风格。 📦 开箱即用的高质量 Razor 组件,可在多种托管方式共享。 💕 支持基于 WebAssembly 的客户端和基于 SignalR 的服务端 UI 事件交互。 🎨 支持渐进式 Web 应用(PWA) 🛡 使用 C# 构建,多范式静态语言带来高效的开发体验。 ⚙️ 基于 .NET Standard 2.1,可直接引用丰富的