UX touch-friendly: add Evaluate button; increase min sizes/spacing; make variables/functions tap-to-insert via InsertVariable/InsertFunction commands.
This commit is contained in:
parent
0b06265117
commit
055c2fae03
2 changed files with 74 additions and 34 deletions
|
@ -41,6 +41,37 @@ public partial class MainViewModel : ViewModelBase
|
|||
IsFunctionsPanelOpen = !IsFunctionsPanelOpen;
|
||||
}
|
||||
|
||||
// Insert helpers for touch: appends tokens to the input box
|
||||
[RelayCommand]
|
||||
private void InsertVariable(string? variableName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(variableName))
|
||||
return;
|
||||
InsertToken(variableName);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void InsertFunction(string? functionName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(functionName))
|
||||
return;
|
||||
InsertToken(functionName + "()");
|
||||
}
|
||||
|
||||
private void InsertToken(string token)
|
||||
{
|
||||
if (string.IsNullOrEmpty(InputText))
|
||||
{
|
||||
InputText = token;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!char.IsWhiteSpace(InputText[^1]))
|
||||
InputText += " ";
|
||||
|
||||
InputText += token;
|
||||
}
|
||||
|
||||
[RelayCommand(AllowConcurrentExecutions = false)]
|
||||
private async Task Submit()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue