예제 #1
0
        private void RefreshMaximiseIconState(Window parentWindow)
        {
            if (parentWindow == null)
            {
                return;
            }

            if (parentWindow.WindowState == WindowState.Normal)
            {
                var maxpath = (Path)max.FindName("MaximisePath");
                maxpath.Visibility = Visibility.Visible;

                var restorepath = (Path)max.FindName("RestorePath");
                restorepath.Visibility = Visibility.Collapsed;

                max.ToolTip = Maximize;
            }
            else
            {
                var restorepath = (Path)max.FindName("RestorePath");
                restorepath.Visibility = Visibility.Visible;

                var maxpath = (Path)max.FindName("MaximisePath");
                maxpath.Visibility = Visibility.Collapsed;
                max.ToolTip        = Restore;
            }
        }
예제 #2
0
 public void Bug484164()
 {
     Button b = new Button { Content = "Button" };
     string n = "Bob";
     b.SetValue(FrameworkElement.NameProperty, n);
     TestPanel.Children.Add(b);
     Assert.IsNotNull(b.FindName(n));
 }
예제 #3
0
 public void Bug484164b()
 {
     Button b = new Button { Content = "Button" };
     string n = "Bob";
     b.SetValue(FrameworkElement.NameProperty, n);
     TestPanel.Children.Add(b);
     EnqueueDelay(TimeSpan.FromSeconds(.2));
     EnqueueCallback(() => Assert.IsNotNull(b.FindName(n)));
     EnqueueTestComplete();
 }
예제 #4
0
        private void RefreshMaximizeIconState(Window parentWindow)
        {
            if (parentWindow == null)
            {
                return;
            }

            if (parentWindow.WindowState == WindowState.Normal)
            {
                var maxpath = (UIElement)max.FindName("PART_MaximizeButtonContent");
                if (maxpath != null)
                {
                    maxpath.Visibility = Visibility.Visible;
                }

                var restorepath = (UIElement)max.FindName("PART_RestoreButtonContent");
                if (restorepath != null)
                {
                    restorepath.Visibility = Visibility.Collapsed;
                }

                max.ToolTip = Maximize;
            }
            else
            {
                var restorepath = (UIElement)max.FindName("PART_RestoreButtonContent");
                if (restorepath != null)
                {
                    restorepath.Visibility = Visibility.Visible;
                }

                var maxpath = (UIElement)max.FindName("PART_MaximizeButtonContent");
                if (maxpath != null)
                {
                    maxpath.Visibility = Visibility.Collapsed;
                }
                max.ToolTip = Restore;
            }
        }
예제 #5
0
파일: UIElementTest.cs 프로젝트: snorp/moon
		public void TagPropertyNamescope2 ()
		{
		        Canvas c;
			Canvas c2;
			Button b;

			c = (Canvas)XamlReader.Load (@"
<Canvas xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""Canvas"" />");

			b = new Button ();
			b.Name = "Button";


			Assert.IsNotNull (c.FindName ("Canvas"), "1");

			c.Tag = b;

			Assert.IsNull (c.FindName ("Button"), "2");
			Assert.IsNull (b.FindName ("Canvas"), "2.5");

			c.Children.Add (b);

			Assert.IsNotNull (c.FindName ("Button"), "3");
			Assert.IsNotNull (b.FindName ("Canvas"), "2.5");

			c = (Canvas)XamlReader.Load (@"
<Canvas xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""Canvas"" />");
			c2 = (Canvas)XamlReader.Load (@"
<Canvas xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""Canvas2"" />");

			b = new Button ();
			b.Name = "Button";

			c.Tag = b;

			c2.Children.Add (b);
			Assert.IsNull (c.FindName ("Button"), "4");
			Assert.IsNotNull (c2.FindName ("Button"), "5");
			Assert.IsNull (b.FindName ("Canvas"), "5.5");
			Assert.IsNotNull (b.FindName ("Canvas2"), "5.75");
		}