-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
[SelectedItem] Has anyone successfully made rec subModelSelectedItem
work using either *dynamic* or *static* bindings?
#620
Comments
subModelSelectedItem
* work using *either dynamic or static bindings*?rec subModelSelectedItem
work using either *dynamic* or *static* bindings?
[Documentation]: I insist: If its indeed a limitation - either with dynamic or static bindings - it must be clearly communicated upfront (ie in the docs) to ElmishWPF API users to prevent them from wasting time and effort, potentially falling into the same rabbit hole I am stucked in for months now, and associated anxiety (which, in my case, is quite significant now). That said, months later, I still hold out hope that it can work (though I acknowledge I may be influenced by a sunk cost fallacy bias). if you • @marner2 - I know I ask you a lot of questions but all I need is a little direction for
Thank you • @awaynemd - I know that you’ve faced similar/identical challenges regarding multi-level subModelSelectedItem, and that you might have felt as desperate as I do now. However, you had the privilege/chance of seeking help during the "ElmishWPF Community Golden Era," when support was more readily available. I’d really like to know if you managed to get it working and, if possible, whether you could share a small code sample. I’d truly appreciate it. Thank you very much • @TysonMN -I’m sorry for repeatedly asking the same question (and please don’t misunderstand me—I really hate being that "pain in the ass" guy..), but despite going over and over again through all the old ElmishWPF issues/PR history related to |
@YkTru, come on. If I knew how to do this, then I would tell you. |
Quoting #619 (comment)
Please share a git repository containing feature branches with your various attempts. Also clearly describe what doesn't work or what you don't like. You can include static attempts, but I will only be considering the dynamic attempts. |
I apologize; I thought perhaps you knew but either didn’t have the time to write a full example, didn’t remember the exact details (most of the discussions on this topic in "Issues/PR" are from 2020), or it might have been private code from your previous work at the company. That said, I think I’ve made some progress, although certain aspects feel hacky and less than ideal (note: some of the code was generated by GPT-o1 (mostly in the
Here is the repository containing only a dynamic attempt (which is not too different from my earlier static attempts so I can build from it I guess) If you find the code difficult to read or follow, I'll take time to rewrite/refactor it just let me know. |
Video_2024-12-17_004322.mp4[What I think works]:
[Issues]:
-ListView Deselection: I added a
As an additional note, I’d like to point out that this related ElmishWPF sample) exhibits a similar deselection issue. In fact, it performs even worse—the MoveUp/MoveDown functionality simply toggles the item in place: Video_2024-12-16_051905.mp4Well, I hope you’ll be able to help. Thanks a lot |
In fact, I get this XAML Binding Failures as soon I select any item, even though the selection functionality seems to work thanks only to the behavior I guess:
Debug: For these reasons, I feel the xaml behavior approach might be hacky too, or at least not properly implemented. |
Update: I have opened an issue on the WPF GitHub repository as for the weird UI-deselection behaviors: dotnet/wpf#10182. But the runtime logs seems to tell there is a problem with my ElmishWPF code anyway. @TysonMN Do you have suggestions on how to debug this? (There might be an issue with how I wrote the bindings; I have very little experience with dynamic bindings, so it's difficult for me to determine. Thanks) |
For the WPF issue, in addition to including the code directly in the issue, also include a GitHub repo with that code and any other code needed to immediately reproduce the behavior in the video. You want to make it as easy as possible for others to help you.
Yes. As with all bugs, try to create a minimal reproduction. Do you think your reproduction is minimal?
I am a bit confused by this question. It makes me think that the production you shared in the WPF issue depends on Elmish.WPF, but I didn't see any Emlish.WPF, and it would be bad/wrong to include such code in the reproduction. So to clarify, is there any Elmish.WPF code in that example? |
The "successfully made (...) work" part of my title is of course vague, since - as I'm sure you already know/have experienced - many thing can go wrong using the dreaded WPF SelectedItem (here is another specific example). Here’s what I believe is the minimal requirement (and what I started with):
I created a branch that (I believe) respects only the minimal requirements. I kept the mock and the For the record: what I added during my investigation (repo), which I agree is not "minimal":
|
The fact is I can't currently determine whether the issue lies with Elmish.WPF's Initially, I didn't include the full repository in the 'WPF GitHub issue' because I understand that most people aren't familiar with or don't encourage using F# with WPF. From my experience, this often leads to responses like "Why don't you just use C# + MVVM?" or "can't help: written in F#". I wanted to keep the focus on the |
Then you shouldn't have created an issue in the WPF repo. |
(closed: will a open a more focused issue on dynamic bindings) |
[Problem]: Has anyone fully successfully used
subModelSelectedItem
with a recursive data structure in any ways using the ElmishWPF API, without encountering issues with the WPFSelectedItem
property, and if you can share that code please (ideally not too hacky)?[Context]: there are numerous issues with WPF's
SelectedItem
, which I experienced too using recursive structure (eg: model updates, but not the UI).[Solutions]: More specifically, I want to confirm if it is even feasible to implement this using either dynamic or static bindings or any alternative approaches (e.g.,
twoWayOpt
or other safe/FP-idiomatic techniques that I might not have considered).[Limitations]: If not, it risks failing to support very common desktop application use cases (e.g., file and folder trees, master-detail views with nested items, etc.).
or
Thank you
The text was updated successfully, but these errors were encountered: