Example #1
0
 /// <summary>
 /// Sets the internal HelpLayer instance to attach to the root layout panel of the page.
 /// </summary>
 /// <param name="element">UIElement element.</param>
 /// <param name="value">HelpLayer instance.</param>
 private static void SetLayer(UIElement element, HelpLayer value)
 {
     element.SetValue(LayerProperty, value);
 }
Example #2
0
        /// <summary>
        /// Attaches the frame to the given element.
        /// </summary>
        /// <param name="element">FrameworkElement instance.</param>
        private static void AttachFrame(FrameworkElement element)
        {
            // get the HelpLayer instance
            var panel = TreeHelpers.GetRootPanel();
            if (panel != null)
            {
                var layer = GetLayer(panel);
                if (layer == null)
                {
                    // create a new layer
                    layer = new HelpLayer();
                    SetLayer(panel, layer);
                    layer.AttachToPage(panel);
                }

                // create a new frame and attach it to the layer
                var frame = new HelpFrame();
                frame.Attach(element);
            }
        }