信号-R是否由NET MAUI支持?
我在Blazor Server应用程序中使用了Signal-R,但是我看不到在.NET MAUI中实现它的方法。显然,这种环境还不支持Signal-R,但我可能错了。
如果是这样,我如何将ihubContext&xhub>
声明为mauipragram.cs中的服务?
I've used Signal-R in a Blazor Server app, but I don't see a way to implement it in .NET MAUI. Apparently this environment doesn't support Signal-R yet, but I might be wrong.
If it is, how do I declare an IHubContext<XHub>
as a service in MauiProgram.cs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,信号r工作
设置:
在您的ViewModel或页面中添加:
声明:
私有Readonly HubConnection _hubConnection;
在页面或View -Modal创建/构造函数上:
必要时初始化连接:
URL类似:
您的网站具有类似的内容:
Yes, Signal R Works
Setup:
In your viewmodel or Page add:
Declare:
private readonly HubConnection _hubConnection;
On Page or ViewModal creation/constructor:
Initialise the connection when required:
The url is something like:
Where your site has something like:
我自己没有尝试过(今年晚些时候会做),但是根据这个项目: https ://github.com/matt-goldman/maui-chat 应该支持它。
I haven't tried it myself (will do later this year), but according to this project: https://github.com/matt-goldman/maui-chat it should be supported.