VCurrent and vSelected
No edit summary
No edit summary
Tag: 2017 source edit
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
ViewModels create and maintain vCurrent_ and vSelected_ variables for each level of your viewmodel-nestings. The values are maintained by the framework to reflect what the user has focused/clicked last (vCurrent_) and when you allow multi select in grids the vSelected_ collection is maintained. The variables are strongly typed to match your nestings and get the postfix name from the nesting.
[[Training:ViewModel|ViewModels]] create and maintain vCurrent_ and vSelected_ variables for each level of your ViewModel-nestings.


See this article for a fuller discussion of [https://blog.mdriven.net/cursored-or-full-tree/ how to cursor your viewmodel]
The values maintained by the Framework reflect what the user has focused on/clicked last (vCurrent_), and when you allow multi-select in grids, the vSelected_ collection is maintained.
 
The variables are strongly typed to match your nestings and get the postfix name from the nesting.
 
See this article for a fuller discussion on [[Cursored or Full Tree|how to cursor your ViewModel]].
 
See also: [[Training:How to use vCurrent and “self” correctly in viewmodels|How to use vCurrent and “self” correctly in viewmodels]]
 
==== Update vSelected maintaince in Turnkey ====
Complex issue with vSelected in Turnkey - when you have not checked the SelectedBox - you still want the vCurrent to be part of the vSelected - but then you want it removed from vSelected if the only reason for being in vSelected was that it was vCurrent.
 
This issue is not complex in WPF because there is a natural difference between the focused and selected and UI controls automatically include the focused in the selected collection - but on the web we have the extra checkbox and we must know the reason for being in vSelected - is it only because we was vCurrent before - and thus should we be removed from vSelected.
 
<html>
<div class="video">
  <div class="video__wrapper">
    <iframe src="https://www.youtube.com/embed/u-qeBxf99R4?si=1rRQMYB8MLtThcvw" title="YouTube video player" frameborder="0" allowfullscreen></iframe>
  </div>
 
</html>
 
{{Edited|July|12|2024}}

Latest revision as of 05:14, 4 March 2024

ViewModels create and maintain vCurrent_ and vSelected_ variables for each level of your ViewModel-nestings.

The values maintained by the Framework reflect what the user has focused on/clicked last (vCurrent_), and when you allow multi-select in grids, the vSelected_ collection is maintained.

The variables are strongly typed to match your nestings and get the postfix name from the nesting.

See this article for a fuller discussion on how to cursor your ViewModel.

See also: How to use vCurrent and “self” correctly in viewmodels

Update vSelected maintaince in Turnkey

Complex issue with vSelected in Turnkey - when you have not checked the SelectedBox - you still want the vCurrent to be part of the vSelected - but then you want it removed from vSelected if the only reason for being in vSelected was that it was vCurrent.

This issue is not complex in WPF because there is a natural difference between the focused and selected and UI controls automatically include the focused in the selected collection - but on the web we have the extra checkbox and we must know the reason for being in vSelected - is it only because we was vCurrent before - and thus should we be removed from vSelected.


This page was edited 69 days ago on 03/04/2024. What links here