Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

.Net 8 Blazor Server#3940

Unanswered
Bond-Addict asked this question inQ&A
Dec 25, 2024· 1 comments· 1 reply
Discussion options

I've been spinning my wheels looking at ReactiveUI, ReactiveUI.Fody, ReactiveUI.SourceGenerator and even Fody/PropertyChanged.Fody.

I cannot for the life of me figure out how to get it implemented. I've trying to find videos, combing through every piece of documentation onhttps://www.reactiveui.net/ or any question concerning those packages on StackOverflow. The documentation is extensive but also leave a lot of questions unanswered.

https://www.reactiveui.net/docs/getting-started/installation/blazor.html states:

InstallReactiveUI into your netstandard libraries and tests.
InstallReactiveUI.Blazor into your application.
InstallReactiveMarbles.ObservableEvents.SourceGenerator into your application.
InstallReactiveUI.Testing into your tests.

But then I never see mention of ReactiveMarbles.ObservableEvents.SourceGenerator again.

I've been tohttps://github.com/reactiveui/ReactiveUI.Samples/tree/main/blazor
But the server sample is only using ReactiveUI.Blazor but then includes FodyWeavers.xml.

Please help me understand how this all works. I've hit a total wall at this point and have spent several day now trying to figure out how this all connects.

This is my goal:

My Class flow is

(MainModel => FirstCollection) =>
(SecondModel => NestedProperty) =>
(ThirdModel => NestedProperty) =>
(FourthModel => SecondCollection) =>
(FithModel (Constains a bunch of properties and is the last model in the chain)

When any property of FithModel change, MainModel needs to be notified. Basically if there is any change, to any property anywhere in MainModel, MainModel should be notified. I then have a razor page with and EditContext that is watching MainModel. When MainModel detects that change,EditContext.OnFieldChanged should be triggered.

Essentially when anything in MainModel changes I just want it to say "Hey! I changed!" I dont care what the actual value or what property changed, just that something changed.

My use-case:
We have a form which initially prepopulates via an existing record in our database. You have the ability to make form selection changes before generating a report. What happens currently, is that after a report has been generated (which creates a clickable report link in the form of a button) you can then go make a change to a form selection and then could accidently look at the previous report. I need to know every time any form selection changes, so I can clear out that link forcing the user to regenerate the report, creating a new report link.

It should be noted that this is an application that I inherited and thus had no input on the application architecture.

The goal is to have as minimal boilerpate code for change detection.

Thank you for your help! ❤️

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Won't go into all the details of your question until after Christmas but here's some top level information

Fody is an older way of generating boiler plate code. We have since recently implemented a source generator which generates boiler plate code around property notifications etc. it's much easier for us to maintain than a Fody.

Observable Events generates IObserable for existing events mainly used for UI objects. Again not strictly needed. Just auto generates boiler plate code. Theres a lot of documentation in the repo. It's not part of the main reactiveui libraries so we don't explicitly mention it in the reactiveui documentation.

You must be logged in to vote
1 reply
@Bond-Addict
Comment options

Thanks for the quick response! I've looked through documentation on each of the relevant packages which has still left me quite puzzled. I've been in the game for about a years now so usually I can stumble my way through documentation pretty well 😅

Coming from a background of Angular and Vue whose core fundamentals are reactivity has kinda spoiled me. That's caused immence frustration with Blazor because it feel I'm having to fight my tools to get basic (IMO) functionality such as reactivity and validation(which seems be tied back to the reactivity issues) to work properly.

After Christmas is more than okay. Thanks for being willing to help at all! 🙂

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@Bond-Addict@glennawatson

[8]ページ先頭

©2009-2025 Movatter.jp