SplitButton action

Dec 7, 2010 at 6:01 AM

Here is my XAML code for splitbutton (fluent ribbon splitbutton).

        <ControlTemplate x:Key="splitButton">
            <ef:SplitButton Header="{Binding DisplayName}" ItemsSource="{Binding Items}" LargeIcon="{Binding LargeIconPath}" cm:Message.Attach="ClickAction()">
                <ef:SplitButton.ItemContainerStyle>
                    <Style TargetType="MenuItem">
                        <Setter Property="Header" Value="{Binding DisplayName}"/>
                        <Setter Property="Icon">
                            <Setter.Value>
                                <Image Source="{Binding Path=IconPath}"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="ItemsSource" Value="{Binding Items}"/>
                        <Setter Property="cm:Message.Attach" Value="ClickAction()"/>
                    </Style>
                </ef:SplitButton.ItemContainerStyle>
            </ef:SplitButton>
        </ControlTemplate>

The action (ClickAction) never gets fired, but "same" code for normal button works ok. Is there some trick in binding command to splitbutton?

The code works if i create a Click event in my viewModel and bind it to xaml Click property, but im not sure why cm:Message.Attach doesnt work (it works on splitbutton menuItems and normal button).

Coordinator
Dec 7, 2010 at 1:00 PM

I'm going to need a simple repro to try and fix this. You can email it to robertheisenberg at hotmail dot com