dotnet / dotnet/vblang

Proposal: Feature requirement. Function limitations inside XAML

Open
#495 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

I wish to write a TextBlock in UWP-XAML as below.
``

But (**Issues**)
1. Functions are not allowed inside functions in XAML [Val()].
2. "3/100" type of mathematical operations are not allowed.
3. The value in `TxbOrgEffort` textblock is expected to be multiplied by 3% and bound to `TxbReqSuggested` textblock. But XAML function can take only Double type parameter and does not accept UIElement -> TextBlock.
4. "Error XLS0526 Static method 'EffortVal(txbOrgEffort, 0.03)' not found in type 'MyHelpers'". This error occurs when I take first parameter is of type TextBlock type. "Static means Public keyword in VB I assume. But the function "EfforVal" exists in MyHelpers class. It takes Textblock type as first parameter. Inside the function, I use Val() function to take the numeric value and multiply the second parameter of the function and return. But I only have XLS0526 error.

If I make the function in MyHelpers class to take two parameters, one with TextBlock type and other with value, the XAML does not pass the textblock element to first parameter.

We want (**Solution**)
1. All VB inbuilt functions like Val(), Str(), InStr(), InStrRev(),... should be usable from XAML UI (at least for Binding purpose.
2. XAML should be capable of passing another UI element (like textblock/textbox) to function ByRef and ByVal as parameter.
3. Support mathematical operations in Binding.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.