public Test() { dock_panel = new DockPanel(); check_box = new CheckBox(); check_box.Checked += check_box_Checked; check_box.Unchecked += check_box_Unchecked; DockPanel.SetDock(check_box, Dock.Top); dock_panel.Children.Add(check_box); Button button = new Button(); button.Content = "YOOHOOO"; button.Click += button_Click; DockPanel.SetDock(check_box, Dock.Bottom); dock_panel.Children.Add(button); text_block = new TextBlock(); text_block.Text = "HELLOOOOOOO"; dock_panel.Children.Add(text_block); WizardDPs.SetPointOfInterest(text_block, "TB"); WizardDPs.SetPointOfInterest(check_box, "Wizard:1:CheckBox"); WizardDPs.SetPointOfInterest(button, "Wizard:1:Button"); ControlHostingWindow chw = new ControlHostingWindow("Test", dock_panel); PointOfInterestLocator poi_locator = new PointOfInterestLocator(); Player player = new Player(poi_locator, TestWizard.GetRoute()); chw.Show(); }
public Player(PointOfInterestLocator poi_locator, Route route) { InitializeComponent(); this.Background = ThemeColours.Background_Brush_Blue_VeryDark; this.poi_locator = poi_locator; this.route = route; this.CmdNext.Background = Brushes.LightGreen; this.CmdNext.Click += CmdNext_Click; dispatcher_timer = new DispatcherTimer(); dispatcher_timer.Interval = new TimeSpan(0, 0, 0, 0, 250); dispatcher_timer.Tick += dispatcher_timer_Tick; opacity_animation = new DoubleAnimation(0.5, 1, new Duration(new TimeSpan(0, 0, 0, 0, 1000))); opacity_animation.RepeatBehavior = RepeatBehavior.Forever; opacity_animation.AutoReverse = true; opacity_animation.AccelerationRatio = 0.1; ControlHostingWindow window = new ControlHostingWindow(route.Title, this); window.BorderThickness = new Thickness(0); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.WindowStyle = WindowStyle.ToolWindow; window.Topmost = true; window.Show(); }
public static bool AreAnyPOIsVisible(PointOfInterestLocator point_of_interest_locator, params string[] pois) { foreach (string poi in pois) { List <DependencyObject> poi_list = point_of_interest_locator.GetPOI(poi); if (null != poi_list) { foreach (DependencyObject dep_obj in poi_list) { FrameworkElement fe = dep_obj as FrameworkElement; if (null != fe) { if (fe.Visibility == Visibility.Visible) { return(true); } } } } } return(false); }