« first day (3798 days earlier)      last day (351 days later) » 

08:26
Oh. There is a WPF chat room. I just asked the following question in the C# room, I guess it should have been posted here, sorry for the double post.
So: I was playing around in my mind with the idea of creating computed viewmodel properties by means of linq expressions so that by parsing the expression tree I can discover the dependencies instead of having to add calls to cumbersome and error-prone ObservesProperty(). Does anyone have any experience with this? Is there any product out there that already does this?
 
5 hours later…
13:32
I'm not aware of any library that does exactly what you describe, no. I think it would be at least interesting to see!
But I will say there have been a variety of ways to get around the boilerplate of writing e.g. INPC calls by hand; often you wind up paying a performance cost, since C# didn't have compile-time source generation facilities until fairly recently. With source generation you can modify the code at compile time to have minimal-cost change notification, otherwise you have to pay the cost somewhere at runtime to inspect the VM
so having something which readily does that for sets of linq expressions is probably a useful idea! I feel like some not-very-featureful version of this exists or exists in part in some database library offering, but not in exactly the way you describe it
14:20
So based on everyone's feedback, I think I'm going to try going with Avalonia
@MikeNakis There's an IL rewriter out there called Fody that has a plugin for injection of INPC. Might be what you're looking for. github.com/Fody/PropertyChanged
@MikeNakis There are also a bunch of Source Generators that will do INPC, which honestly is probably a better approach nowadays vs Fody and the like
15:17
And RE: WPF at this point, i am certainly hearing the consensus to go Avalonia at this point for newer projects. WPF is definitely dead as far MS is concerned. It's the VB of the desktop world now and somehow WinForms keeps living on.
 
1 hour later…
16:30
@Zarenor source generation, even runtime MSIL generation, is a bit like magic, and I am in favor of reducing magic. I use magic for things that cannot be done otherwise, for example generating proxy classes. Parsing the expression tree would allow a magic-free solution, and I believe there is inherent benefit in that.
True, it would not perform as well as code generation, but then code generation could be seen as an optimization on top of a base mechanism that would do the job using conventional means. (Insofar as Expression Trees can be considered conventional.)
I would be grateful if you could point me to anything that does even remotely what I am looking for, (for example that database library offering you spoke of,) because I'd like to get some ideas from existing code before I start getting dirty with it.
I do not have experience with linq used for querying databases, but if they allow creating a WHERE clause where the expression terms are mapped to database fields, then they must have done most of what I want to do.
@LynnCrumbling thanks, I learned about Fody while researching this. It would accomplish the end-goal of not having to use ObservesProperty() but it would not help with my immediate goal to do it myself using expression trees and avoid magic.
By the way, yes, Avalonia seems like a good option, I am eyeing it too! (-:=
 
3 hours later…
19:53
@Maverik WinForms lives due to being legacy (and therefore needs to be supported for legacy projects, or else all the companies will get mad), but WPF doesn't count as legacy enough, while also not counting as new and fresh enough
@MikeNakis my biggest source of expression tree comprehension is EF's source code.
and of course it fits with your WHERE clause too
i went through it trying to my own LINQ provider back in the day that could speak to ODATA but somebody else beat me to it and i never went too far in (i also dont remember expression parsing at this unfortunately, but EF source was very helpful to decipher expression magic under the hood)
@milleniumbug true but you'd expect it to go in support only mode.. not be highlighted in stuff like .net 7 release notes..
but neither VB nor WinForms would really go in background enough to finally die. I mean COBOL is still alive and kicking in many sectors but we dont see it get highlighted and so people have moved on
=b <-- my poor attempt at an ascii-thumb-up.
@Alex This is a pretty old message, I think it needs clarification: not using a Startup class is optional, we use it in our .NET 6 microservices
like sure, the Startup-less project with only Program.cs is created by default now, but you can disregard that just fine and write a startup class and a Program.cs file with a Program class and Main
Also I should check out MAUI
write a simple project
see how it goes
I don't expect much to be honest

« first day (3798 days earlier)      last day (351 days later) »