Last modified on 3 August 2026, at 08:46

Difference between revisions of "EditPropertyValueCommand"

m
(Scan to Input)
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
  
  
=== Command Properties ===
+
== Command Properties ==
 
* ID: String. The ID of the property to be edited.
 
* ID: String. The ID of the property to be edited.
* ScanToInput: bool. If this is false (default) a textbox for editing is shown. If true, a scan dialog appears, that allows to scan a barcode.
 
  
 
Example:
 
Example:
 +
<source lang = "xml">
 +
<Button Command="{Binding EditPropertyValueCommand}" Text="Edit">
 +
<Button.CommandParameter>
 +
<uc:KeyValueList>
 +
<uc:KeyValueParameter Key="ID" Value="TEXT_READWRITE" />
 +
</uc:KeyValueList>
 +
</Button.CommandParameter>
 +
</Button>
 +
</source>
 +
 +
=== Scan to Input ===
 +
* ScanToInput: bool. Default value is false.
 +
 +
A custom button can be added to the UI to trigger the scanning control by default when the string edit window is opened, simply by adding the following KeyValueParameter:
 
<source lang = "xml">
 
<source lang = "xml">
 
<Button Command="{Binding EditPropertyValueCommand}" Text="ScanToEdit">
 
<Button Command="{Binding EditPropertyValueCommand}" Text="ScanToEdit">
Line 22: Line 35:
 
</Button>
 
</Button>
 
</source>
 
</source>
 +
 +
 +
{{Version/MobileSince|5.2}} A toggle button to do from within the [[Editors#String_value_editor|string edit dialogue]] was added to the standard UI.
  
 
[[Category:XAML|EditPropertyValueCommand]]
 
[[Category:XAML|EditPropertyValueCommand]]

Latest revision as of 08:46, 3 August 2026

This command is used to open a dialog for editing a property.

It is located on the ContentViewModel, and as such can be used from the UI of an object to edit its MetaProperties.

IC Attention.pngNote that a Save and Commit on the ContentViewModel is automatically triggered once the edit is confirmed.
IC Hint square.pngIf your usecase requires that the property change is not automatically saved, instead use the (PropertyViewModel).ShowEditorCommand / .PropertyClickedCommand to trigger the edit dialogue of a specific MetaProperty.


Command Properties

  • ID: String. The ID of the property to be edited.

Example:

<Button Command="{Binding EditPropertyValueCommand}" Text="Edit">
        <Button.CommandParameter>
                <uc:KeyValueList>
                        <uc:KeyValueParameter Key="ID" Value="TEXT_READWRITE" />
                </uc:KeyValueList>
        </Button.CommandParameter>
</Button>

Scan to Input

  • ScanToInput: bool. Default value is false.

A custom button can be added to the UI to trigger the scanning control by default when the string edit window is opened, simply by adding the following KeyValueParameter:

<Button Command="{Binding EditPropertyValueCommand}" Text="ScanToEdit">
        <Button.CommandParameter>
                <uc:KeyValueList>
                        <uc:KeyValueParameter Key="ID" Value="TEXT_READWRITE" />
                        <uc:KeyValueParameter Key="ScanToInput" Value="true" />
                </uc:KeyValueList>
        </Button.CommandParameter>
</Button>


A toggle button to do from within the string edit dialogue was added to the standard UI.