reactivemarbles / ObservableEvents

MIT License
122 stars 10 forks source link

No Events for WPF DataGridRow #77

Open kgday opened 3 years ago

kgday commented 3 years ago

This is the code I had when using the old ReactiveUI.Events.WPF

                    FileItemsDataGrid
                        .Events()
                        .LoadingRow
                        .SelectMany(loadingRowArgs => loadingRowArgs.Row.Events().MouseEnter.Select(_ => loadingRowArgs.Row.DataContext as IFileViewModel))
                        .WhereNotNull()
                        .Subscribe(vm => vm.CurrentlyHoveredOver = true)
                        .DisposeWith(d);

but with ReactiveMarbles/.ObservableEvents there is no events (NullEvents) for loadingRowArgs.Row which is a DataGridRow type.

Thanks..

glennawatson commented 3 years ago

<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation> you need that one I believe in the property group of your csproj

glennawatson commented 3 years ago

https://github.com/microsoft/CsWin32/issues/7

kgday commented 3 years ago

Thanks, but I had that already.

kgday commented 3 years ago

I use Events() extensively and it works for everything else except for DataGridRow. I have an idea that it is because the only reference to the datagrid row type is in the selectmany.

kgday commented 3 years ago

I tried adding a

public DataGridRow? dummyRow; //just so events observable can be generagted

But it didn't help.

kgday commented 3 years ago

Going back to ReactiveUI.Events.WPF for now. My current computer is too slow to use this source generator anyhow as it is, even with version 1.1.4. Hopefully before too long I will upgrade :-)