ObservableEvents do not work with generic classes like ObservableCollection<T>.
ObservableEvents do not work with generic classes like ObservableCollection<T>.
Build the following code:
public class Class1<T>
{
public event EventHandler TestEvent;
void TestMethod()
{
ObservableCollection<Class1<int>> collection = new();
Class1<int> c = new();
c.Events().TestEvent.Subscribe();
collection.Events().PropertyChangedEventHandler.Subscribe(x => { });
}
}
will cause error:
1>CSC : warning CS8785: Generator 'EventGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'SourceClassClassLibrary1.Class1<System.Int32>-InstanceEvents.SourceGenerated.cs' contains an invalid character '<' at position 31. 1>C:\Projects\ClassLibrary1\ClassLibrary1\Class1.cs(5,7,5,22): error CS0246: The type or namespace name 'ReactiveMarbles' could not be found (are you missing a using directive or an assembly reference?)
I think this is because '<' is not a valid character for Windows paths.
That makes sense, I'll see if I can get some time this weekend to fix it for you. Otherwise can accept a PR.
Tried this library in a generic class, in JetBrains Rider.
I add this, fine.
using ReactiveMarbles.ObservableEvents;
as soon as I type this.Events()., Events turns red and ReactiveMarbles is no longer a recognized namespace.
Yeah, let me see if I can solve this one for you on the weekend. I've been having some family issues the last couple of months but hope to get some time this weekend to
I think everyone got family issues lately.