Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace BlazorStateComponent to IBlazorStateComponent in Subscriptions #261

Merged
merged 1 commit into from
Aug 15, 2021

Conversation

megafetis
Copy link
Contributor

It will help to create subscribable LayoutComponentBase components and InputBase components using method from documentation:

protected T GetState<T>()
    {
      Type stateType = typeof(T);
      Subscriptions.Add(stateType, this); // where this is IBlazorStateComponent
      return Store.GetState<T>();
    }

@StevenTCramer
Copy link
Collaborator

@megafetis Thanks for the PR. It looks good. Thanks much.

@StevenTCramer StevenTCramer merged commit 0a04755 into TimeWarpEngineering:master Aug 15, 2021
@neozhu
Copy link

neozhu commented Dec 3, 2022

hello @megafetis
How to inherit BlazorStateComponent on the main page that has inherited LayoutComponentBase?
as we know, the blazor component does not support multi inherit classes.

@StevenTCramer
Copy link
Collaborator

@neozhu as you state you can't inherit from multiple classes in C#. But you can implement multiple interfaces. So you could implement IBlazorStateComponent in your Layout Component. See #305.

@neozhu
Copy link

neozhu commented Dec 4, 2022

@StevenTCramer Thanks for the tip, I got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants