You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is a common topic/problem in MVVM, but I still can't get my head around it, so beware, I may sound confused. (when I say "log", I mean in-app TextBlock logging, not Serilog)
Is it a good idea to make a "WPF Helper" module to help with various harder to accomplish MVVM task? (get focuses/selected element for logging, set the border color of an element in a file to depend on an element in another file etc.)
Does this Elmish sample can be made as a function (service) so we won't have to repeat "GotFocus/LostFocus etc." for each element needed such behaviors? (idem for logging)
Again with a "global approach" in mind, would you advise to make a global anonymous style (App.xaml) targeting x:Type UIElement (or FrameworkElement?) where I can put behaviors in a template (eg.: "LogWhenSelected/Focused", "ChangeBorderColorOnExternalEvent", "DragDropBehavior", etc)?
Could you provide advices on how to organize such a module + some code too please?
Thank you
The text was updated successfully, but these errors were encountered:
YkTru
changed the title
WPF Helpers in Elmish.Core: GetFocusedElement, GetSelectedElement(s), Update{Property}OnFocus, etc.
WPF Helpers in Elmish.Core: GetFocusedElement, GetSelectedElement(s), Update{Property}OnFocus, etc. :: A global approach ::
Jan 19, 2024
YkTru
changed the title
WPF Helpers in Elmish.Core: GetFocusedElement, GetSelectedElement(s), Update{Property}OnFocus, etc. :: A global approach ::
WPF Helpers: GetFocusedElement, GetSelectedElement(s), Update{Property}OnFocus, etc. :: A global approach ::
Jan 19, 2024
YkTru
changed the title
WPF Helpers: GetFocusedElement, GetSelectedElement(s), Update{Property}OnFocus, etc. :: A global approach ::
WPF Helpers: GetFocusedElement, GetSelectedElement(s), DragDrop, etc. :: A global approach ::
Jan 19, 2024
My impression is that these issues are all independent of Elmish.WPF. Therefore, I don't think it would be a good idea to have helpers in Elmish.WPF for them.
My first recommendation would be to write the code you want and organize it in a reusable way. If this became a large amount of code, then consider using an existing library that provides much of the same functionality.
I know this is a common topic/problem in MVVM, but I still can't get my head around it, so beware, I may sound confused. (when I say "log", I mean in-app TextBlock logging, not Serilog)
Could you provide advices on how to organize such a module + some code too please?
Thank you
The text was updated successfully, but these errors were encountered: