Binding inside MenuFlyout inside TemplatedControl does not work the first time
Opened this issue · 1 comments
Trueber commented
Describe the bug
On our project, we use a MenuFlyout on a Button in a TemplatedControl that is dynamically modified based on another binding property.
The first time the button is pressed on each TemplatedControl, the Bindings in he MenuFlyout are not bound correctly. After the second time each button is pressed, everything works as expected.
To Reproduce
<Button >
<avalonia:MaterialIcon Foreground="Gray" Kind="Menu" MinHeight="48" MinWidth="48" />
<Button.Flyout>
<MenuFlyout>
<MenuItem
IsVisible="{TemplateBinding MenuItem1Visible}"
Header="{TemplateBinding Header1}"
Command="{TemplateBinding MenuItem1}"
CommandParameter="{TemplateBinding State}">
</MenuItem>
<MenuItem
IsVisible="{TemplateBinding MenuItem2Visible}"
Header="{TemplateBinding Header2}"
Command="{TemplateBinding MenuItem2}"
CommandParameter="{TemplateBinding State}">
</MenuItem>
</MenuFlyout>
</Button.Flyout>
</Button>
Expected behavior
The Bindings already work on the first time each button is pressed.
Avalonia version
11.x.x
OS
Windows, Linux
Additional context
No response
alextim commented
Has the same problem