You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A custom control Changer has one bindable property Text and 2 buttons:
Up (incrementing the Text) and
Down (decrementing Text as long as Text is positive). The Down button is disabled when Text is 0.
MainPage is bound to MainPageViewModel and it has 2 radio buttons:
RadioValueA is bound to ValueA of the MainPageViewModel.
RadioValueB is bound to ValueB of the MainPageViewModel.
Issues
Consider the following screenshots.
Workaround
Manually assign Text after programmatically set-binding it.
ChangerInstance.SetBinding(Changer.TextProperty,nameof(MainPageViewModel.ValueA));// Why should I call the following?ChangerInstance.Text=_model.ValueA.ToString();
Question
Why should I manually assign Text right after set-binding it?
Should it be done automatically by the framework?
Is it a bug or a feature by design?
This discussion was converted from issue #27445 on January 31, 2025 15:21.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
Changer
has one bindable propertyText
and 2 buttons:Up
(incrementing theText
) andDown
(decrementingText
as long asText
is positive). TheDown
button is disabled whenText
is 0.MainPage
is bound toMainPageViewModel
and it has 2 radio buttons:RadioValueA
is bound toValueA
of theMainPageViewModel
.RadioValueB
is bound toValueB
of theMainPageViewModel
.Issues
Consider the following screenshots.
Workaround
Manually assign
Text
after programmatically set-binding it.Question
Why should I manually assign
Text
right after set-binding it?Should it be done automatically by the framework?
Is it a bug or a feature by design?
Repository
Here is my repo: https://github.com/suugbut/dynamic-setbinding-bug
Beta Was this translation helpful? Give feedback.
All reactions