Changes

Property Direct Edit (Client)

1,752 bytes added, 13:04, 16 June 2023
/* PropertyViewModel */
{{Hint|Once again, you can use the [[Developer_Mode]] to find out more about the PropertyViewModel, like where they are available and how they can be accessed in XAML, or what other members are available underneath, etc.}}
 
=== ValueItem.PropertyValue or ValueItem.PropertyValueSessionless {{Version/WinXSince|4.4}}{{Version/XamarinSince|4.4}} ===
When it comes to property editing, there's the concept of edit sessions. A property editor always entails a session which starts when the editor is opened and ends when the editor is closed.
However, this could be different in direct editing. For example,
* The standard UI in {{UBIK}} for direct string editing still has sessions. The session starts when you click on the displayed value text and it turns into a text box for value input. It ends when you confirm the input value and the text box turns back into the displayed value text.
* On the other hand, the direct boolean editing is, for example, sessionless. This is because the UI displays a check box the entire time and there's no way to tell the start or the end of a session.
 
 
For most value types (e.g. where typing is involved during direct editing), the session concept still applies. '''ValueItem.PropertyValue''' should be used in bindings in such cases. Otherwise, the input values might be lost during editing. In other cases where direct editing is sessionless, '''ValueItem.PropertyValueSessionless''' should be used. Otherwise, the input value will be rejected since the property is technically speaking not in any edit session.
 
{{Hint|If you are unsure whether '''ValueItem.PropertyValue''' or '''ValueItem.PropertyValueSessionless''' should be used for a certain property type, go with the former. Because most types do have sessions in their direct editing UI. Also, the problem of misusing the former can be seen immediately, namely the editing doesn't work, whereas misusing the latter can lead to more issues that are hard to notice at first.}}
[[Category:Client|Property Direct Edit (Client)]]