Exemplo n.º 1
0
        /// <summary>
        /// Display a notification to display on top right corner of canvas
        /// and display message passed as param
        /// </summary>
        /// <param name="content">The target content to display.</param>
        internal void CreateRealTimeInfoWindow(string content)
        {
            //Search a UIElement with the Name "statusBarPanel" inside the Dynamo VisualTree
            UIElement hostUIElement = Guide.FindChild(mainRootElement, "statusBarPanel");

            // When popup already exist, replace the content
            if (exitTourPopup != null && exitTourPopup.IsOpen)
            {
                exitTourPopup.TextContent = content;
            }
            else
            {
                // Otherwise creates the RealTimeInfoWindow popup and set up all the needed values
                // to show the popup over the Dynamo workspace
                exitTourPopup = new RealTimeInfoWindow()
                {
                    VerticalOffset   = ExitTourVerticalOffset,
                    HorizontalOffset = ExitTourHorizontalOffset,
                    Placement        = PlacementMode.Left,
                    TextContent      = content
                };

                if (hostUIElement != null)
                {
                    exitTourPopup.PlacementTarget = hostUIElement;
                }
                exitTourPopup.IsOpen = true;
            }
        }