nodify-avalonia icon indicating copy to clipboard operation
nodify-avalonia copied to clipboard

In Calculator example, right context menu selection is not working in: OperationsMenuView.xaml

Open Noemata opened this issue 4 months ago • 4 comments

Not sure what's wrong with the XAML here. Must be Avalonia specific since this looks ok from a WPF perspective. Once the options menu pops up on a right click, selecting an item does not fire the CreateOperationCommand in the OperationInfoViewModel.

                        <Button Content="{Binding Title}"
                                Command="{Binding DataContext.CreateOperationCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
                                CommandParameter="{Binding}"
                                Background="Transparent"
                                BorderBrush="Transparent"
                                Foreground="{DynamicResource ForegroundBrush}"
                                Padding="3"
                                Cursor="Hand"
                                HorizontalContentAlignment="Left">
                            <Button.Theme>
                                <ControlTheme TargetType="{x:Type Button}">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Button}">
                                                <Border Name="Border"
                                                        Background="{TemplateBinding Background}"
                                                        Padding="{TemplateBinding Padding}">
                                                    <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Style Selector="^:pointerover /template/ Border#Border">
                                        <Setter Property="Background"
                                                Value="{DynamicResource NodeInput.BorderBrush}" />                                        
                                    </Style>
                                </ControlTheme>
                            </Button.Theme>
                        </Button>

Noemata avatar Oct 10 '24 22:10 Noemata