title: WPF Quad Context Menu
body: <p><strong>N.B THIS QUESTION HAS BEEN UPDATED, READ FURTHER DOWN</strong></p>
  
  <p>Hi, </p>
  
  <p>I want to create a custom context menu that has 4 sub-menus, each in their own quadrant (top left, top right, bottom left, bottom right). Similar to 3ds Studio Max.</p>
  
  <p>This is how I've approached the issue so far: 
  - create a custom WPF control, derive from ContextMenu[1]<br>
  - declare 4 dependency properties of ContextMenu, these will be menus displayed and can be set from XAML.<br>
  - AddOwner to the ContextMenu.IsOpenProperty, adding a property changed notification.<br>
  - when the IsOpen property changes set the IsOpen property of 4 child context menus.<br>
  - using ContextMenuService set the Vertical and Horizontal offsets of the context menus to make them appear in each quadrant; binding the actual height and width properties to calculate the offsets.    </p>
  
  <p>[1] Need to derive from context menu otherwise you cannot assign it to the ContextMenu property on the Window.</p>
  
  <p>This <em>appears</em> to work, there are issues with the menus <strong>NOT</strong> staying open (they're being closed as the focus is outside the menu) but I'm sure using Reflector.NET find a way around this.</p>
  
  <p>This is my first custom WPF control that I've attempted to write; and not sure if this is best approach. </p>
  
  <p>Any suggestions/ideas on how to create this Quad Context menu?</p>