Microsoft.Phone.Controls.ContextMenu.ContextMenu C# (CSharp) Method

ContextMenu() public method

Initializes a new instance of the ContextMenu class.
public ContextMenu ( ) : System
return System
        public ContextMenu()
        {
            DefaultStyleKey = typeof(ContextMenu);

            _openingStoryboard = new List<Storyboard>();

            if (null == Application.Current.RootVisual)
            {
                // Temporarily hook LayoutUpdated to find out when Application.Current.RootVisual gets set.
                LayoutUpdated += OnLayoutUpdated;
            }
            else
            {
                // We've already missed the LayoutUpdated event, so we are safe to call InitializeRootVisual() to compensate.
                InitializeRootVisual();
            }
        }