A Info text area.
Inheritance: System.Windows.FrameworkElement
        internal static void Start(ref InfoTextEnterArea grayOut, ServiceContainer services, UIElement activeContainer, Rect activeRectInActiveContainer, string text)
        {
            Debug.Assert(services != null);
            Debug.Assert(activeContainer != null);
            DesignPanel   designPanel   = services.GetService <IDesignPanel>() as DesignPanel;
            OptionService optionService = services.GetService <OptionService>();

            if (designPanel != null && grayOut == null && optionService != null && optionService.GrayOutDesignSurfaceExceptParentContainerWhenDragging)
            {
                grayOut = new InfoTextEnterArea();
                grayOut.designSurfaceRectangle = new RectangleGeometry(
                    new Rect(0, 0, ((Border)designPanel.Child).Child.RenderSize.Width, ((Border)designPanel.Child).Child.RenderSize.Height));
                grayOut.designPanel        = designPanel;
                grayOut.adornerPanel       = new AdornerPanel();
                grayOut.adornerPanel.Order = AdornerOrder.Background;
                grayOut.adornerPanel.SetAdornedElement(designPanel.Context.RootItem.View, null);
                grayOut.ActiveAreaGeometry = new RectangleGeometry(activeRectInActiveContainer, 0, 0, (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement));
                var tb = new TextBlock()
                {
                    Text = text
                };
                tb.FontSize            = 10;
                tb.ClipToBounds        = true;
                tb.Width               = ((FrameworkElement)activeContainer).ActualWidth;
                tb.Height              = ((FrameworkElement)activeContainer).ActualHeight;
                tb.VerticalAlignment   = VerticalAlignment.Top;
                tb.HorizontalAlignment = HorizontalAlignment.Left;
                tb.RenderTransform     = (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement);
                grayOut.adornerPanel.Children.Add(tb);

                designPanel.Adorners.Add(grayOut.adornerPanel);
            }
        }
Ejemplo n.º 2
0
		internal static void Start(ref InfoTextEnterArea grayOut, ServiceContainer services, UIElement activeContainer, Rect activeRectInActiveContainer, string text)
		{
			Debug.Assert(services != null);
			Debug.Assert(activeContainer != null);
			DesignPanel designPanel = services.GetService<IDesignPanel>() as DesignPanel;
			OptionService optionService = services.GetService<OptionService>();
			if (designPanel != null && grayOut == null && optionService != null && optionService.GrayOutDesignSurfaceExceptParentContainerWhenDragging) {
				grayOut = new InfoTextEnterArea();
				grayOut.designSurfaceRectangle = new RectangleGeometry(
					new Rect(0, 0, ((Border)designPanel.Child).Child.RenderSize.Width, ((Border)designPanel.Child).Child.RenderSize.Height));
				grayOut.designPanel = designPanel;
				grayOut.adornerPanel = new AdornerPanel();
				grayOut.adornerPanel.Order = AdornerOrder.Background;
				grayOut.adornerPanel.SetAdornedElement(designPanel.Context.RootItem.View, null);
				grayOut.ActiveAreaGeometry = new RectangleGeometry(activeRectInActiveContainer, 0, 0, (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement));
				var tb = new TextBlock(){Text = text};
				tb.FontSize = 10;
				tb.ClipToBounds = true;
				tb.Width = ((FrameworkElement) activeContainer).ActualWidth;
				tb.Height = ((FrameworkElement) activeContainer).ActualHeight;
				tb.VerticalAlignment = VerticalAlignment.Top;
				tb.HorizontalAlignment = HorizontalAlignment.Left;
				tb.RenderTransform = (Transform)activeContainer.TransformToVisual(grayOut.adornerPanel.AdornedElement);
				grayOut.adornerPanel.Children.Add(tb);
								
				designPanel.Adorners.Add(grayOut.adornerPanel);
			}
		}
Ejemplo n.º 3
0
		public static void Stop(ref InfoTextEnterArea grayOut)
		{
			if (grayOut != null) {
				IDesignPanel designPanel = grayOut.designPanel;
				AdornerPanel adornerPanelToRemove = grayOut.adornerPanel;
				designPanel.Adorners.Remove(adornerPanelToRemove);								
				grayOut = null;
			}
		}
 internal static void Stop(ref InfoTextEnterArea grayOut)
 {
     if (grayOut != null)
     {
         IDesignPanel designPanel          = grayOut.designPanel;
         AdornerPanel adornerPanelToRemove = grayOut.adornerPanel;
         designPanel.Adorners.Remove(adornerPanelToRemove);
         grayOut = null;
     }
 }
 internal static void Start(ref InfoTextEnterArea grayOut, ServiceContainer services, UIElement activeContainer, string text)
 {
     Debug.Assert(activeContainer != null);
     Start(ref grayOut, services, activeContainer, new Rect(activeContainer.RenderSize), text);
 }
Ejemplo n.º 6
0
		internal static void Start(ref InfoTextEnterArea grayOut, ServiceContainer services, UIElement activeContainer, string text)
		{
			Debug.Assert(activeContainer != null);
			Start(ref grayOut, services, activeContainer, new Rect(activeContainer.RenderSize), text);
		}