c# - Caliburn Micro Action in ContextMenu with ControlTemplate -
I have a custom component with a context menu in a contact template. I have read some posts with those people who are upset about their work to work in the Contact menu. I have tried out workarounds there, but I can not get it to work. I did not find any target for the method to get the How do I get open to work in my viewhold behind the scene? understand it to work through the . None of these solutions uses a ControlTemplate, although I have tried to bind the model, for menus, to use the TargetWithoutContext property, but none works.
& lt; Components2: ImageBlock background = "transparent" x: name = "share button" margin = "0,0,7,0" & gt; & Lt; Components2: ImageBlock.Style & gt; & Lt; Style TargetType = "{x: Type Components 2: ImageBlock}" & gt; & Lt; Setter Property = "ToolTipService.IsEnabled" Value = "False" /> & Lt; Setter property = "cursor" value = "arm" /> & Lt; Setter Property = "FocusVijual Style" Value = "{x: Faucet}" /> & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: Type Components 2: ImageBlock}" & gt; & Lt; Grid X: Name = "content grid" background = "{template binding background}" minhite = "30" tooltip = "{TemplateBinding ToolTip}" & gt; & Lt; Grid.ContextMenu> & Lt; ContextMenu & gt; & Lt; MenuItem Header = "Facebook" Cal: Message. Attach = "Open (0)" /> & Lt; MenuItem Header = "Twitter" Cal: Message. Attach = "Open (1)]" /> & Lt; MenuItem Header = "Tumbler" Cal: Message. Attach = "Open (2)]" /> & Lt; / ContextMenu & gt; & Lt; /Grid.ContextMenu> & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; / Components2: ImageBlock.Style & gt; & Lt; / Components2: ImageBlock>
PlacementTarget to go to
from the context menu to
ImageBlock . Surprisingly, the setting of
{binding ...} to
ImageBlock via the
Comments
Post a Comment