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

Namespace issue #1

Open
neominky opened this issue Apr 5, 2024 · 0 comments
Open

Namespace issue #1

neominky opened this issue Apr 5, 2024 · 0 comments

Comments

@neominky
Copy link

neominky commented Apr 5, 2024

The "ReactiveCommand" namespace makes it difficult to use the ReactiveCommand.CreateFromTask method used in existing code.
for example

using ReactiveCommand.SourceGenerator.Attributes;
using ReactiveUI;
using System.Reactive;

namespace MyNamespace
{
    public partial class MyViewModel : ReactiveObject
    {
        private ReactiveCommand<Unit, Unit> MyCommand;

        public MyViewModel() {
            InitializeCommands();
            MyCommand = ReactiveCommand.CreateFromTask(DoSomething);  //error
        }
        private async Task DoSomething() {
            Console.WriteLine("Something!");
        }

        [ReactiveCommand]
        public void DoStuff()
        {
            Console.WriteLine("Stuff!");
        }
    }
}

need to add the namespace to all existing command generation code. like this
MyCommand = ReactiveUI.ReactiveCommand.CreateFromTask(DoSomething);
This is boring to everyone.

I'm hoping to change the ReactiveCommand.SourceGenerator namespace a bit.

neominky added a commit to neominky/ReactiveCommand.SourceGenerator that referenced this issue Apr 5, 2024
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

No branches or pull requests

1 participant