TreeView ContextMenu未觸發事件(ContextMenu已打開的事件未觸發),我正在嘗試Caliburn.Micro.Telerik約定未解決的問題。TreeView ContextMenu未觸發事件
TreeViewItemTemplate
<HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding Types}"
ItemTemplateSelector="{StaticResource NamespaceItemTemplateSelector}">
<StackPanel Orientation="Horizontal">
<Path
Data=""
Height="11.458" Margin="0,0,5,0" RenderTransformOrigin="0.5,0.5" Stretch="Fill"
UseLayoutRounding="False" Width="11.264">
<Path.Fill>
<SolidColorBrush Color="#FF333333">
<SolidColorBrush.RelativeTransform>
<MatrixTransform Matrix="Identity" />
</SolidColorBrush.RelativeTransform>
<SolidColorBrush.Transform>
<MatrixTransform Matrix="Identity" />
</SolidColorBrush.Transform>
</SolidColorBrush>
</Path.Fill>
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</Path.RenderTransform>
</Path>
<TextBlock Text="{Binding Header}" Tag="{Binding DataContext, RelativeSource={RelativeSource Self}}">
<TextBlock.ContextMenu>
<ContextMenu cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource Self},Path=UIElement.Tag}" cal:Message.Attach="[Event Opened] = [Action Opened($dataContext)]" >
<MenuItem Header="NewChild" cal:Message.Attach="NewChild($datacontext)"/>
</ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>
</StackPanel>
的TreeView
<TreeView x:Name="TreeView" ItemTemplate="{StaticResource TreeViewItemTemplate}" ItemsSource="{Binding Source}"/>
您的事件沒有觸發或Caliburn.Micro的約定不與您的上下文菜單一起工作的問題? –
感謝您的回覆,Caliburn.Micro約定有效,但ContextMenu和MenuItem事件未觸發。 – Cipher
@Sniffer它沒有任何解決方案?如果你想上傳項目。請幫幫我。謝謝。 – Cipher