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; } }
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)); }
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(); }
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; } }
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"); }