weixin_53764432 2022-02-17 10:23 采纳率: 50%
浏览 14
已结题

谁能帮我看看Blazor中EventConsole使用时需要引用什么命名空间

现在在用asp.net的Blazor+Radzen制作一个todolist,使用的是Radzen的Scheduler组件,但是我复制Radzen给出的实例代码,出现了报错。错误是说我缺少引用命名空间,我缺少了什么命名空间呢?系统没有提示

    EventConsole console;
//中间一部分没问题代码我省略了
async Task OnSlotSelect(SchedulerSlotSelectEventArgs args)
    {
//如果我把第一行的Eventconsole注释掉,下面的console.Log中console就会标红线
        console.Log($"SlotSelect: Start={args.Start} End={args.End}");

        DataItem data = await DialogService.OpenAsync<AddAppointmentPage>("Add Appointment",
            new Dictionary<string, object> { { "Start", args.Start }, { "End", args.End } });

        if (data != null)
        {
            appointments.Add(data);
            // Either call the Reload method or reassign the Data property of the Scheduler
            await scheduler.Reload();
        }
    }

引用的命名空间在这里,相应的radzen需要的配置代码我都输入了
@using System
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using CementStatistic
@using CementStatistic.Shared
@using Radzen
@using Radzen.Blazor

  • 写回答

1条回答 默认 最新

  • Rena Ni 2022-02-17 14:48
    关注

    所以你报错的地方是EventConsole吗? 我看了下EventConsole这是人家在GitHub的radzen-blazor
    库自己自定义的一个组件然后像你这样引用的

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 2月25日
  • 已采纳回答 2月17日
  • 创建了问题 2月17日

悬赏问题

  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计