小编imb*_*b13的帖子

Blazor - 私有组件

有没有办法为正在使用的项目创建一个私有的 Blazor 组件?

例如,让我们看一下ProjectOne包含两个组件的Razor 类库: omponentComponentA和 component ComponentB。该组件ComponentB是component的子级ComponentA

ProjectOne 结构体:

一号计划

- - 成分

---------- ComponentA.razor

---------- ComponentB.razor

还有另一个项目是 Blazor 应用程序ProjectTwo。在这个项目中有一个参考ProjectOneComponentA在 razor 页面中调用组件时,子组件ComponentB也是可见和可访问的。

有没有办法ComponentB只为ProjectOne在组件中使用它的项目在内部创建这个子组件ComponentA

c# .net-core blazor-server-side

6
推荐指数
2
解决办法
279
查看次数

C# - 泛型类列表

我有以下课程:

public abstract class Section
{

}

public class Section<T> : Section where T : new()
{
    public string Type { get; set; }

    public bool IsFocused { get; set; }

    private T sectionData;

    public T SectionData 
    { 
        get => sectionData == null ? sectionData = new T() : sectionData; 
        set => sectionData = value; 
    }
}

public class SectionHeaderData
{
    public string Text { get; set; }

    public int Level { get; set; }
}

public class SectionParagraphData
{ …
Run Code Online (Sandbox Code Playgroud)

c#

3
推荐指数
1
解决办法
277
查看次数

标签 统计

c# ×2

.net-core ×1

blazor-server-side ×1