Last active
December 1, 2015 20:53
-
-
Save julesx/708b9f660cb65db0c922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MarkupExtensionReturnType(typeof(ContentControl))] | |
public class RootObject : MarkupExtension | |
{ | |
public override object ProvideValue(IServiceProvider serviceProvider) | |
{ | |
var rootObjectProvider = (IRootObjectProvider)serviceProvider.GetService(typeof(IRootObjectProvider)); | |
return rootObjectProvider?.RootObject; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ContextMenu DataContext="{Binding DataContext, Source={_3RdParty:RootObject}}"> | |
<MenuItem Header="Remove" Command="{Binding CmdRemoveControllerOperation}" CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" /> | |
</ContextMenu> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment