private void Window_LocationChanged(object sender, EventArgs e) { if (!(w.main.Content is null)) { if (w.main.Content.GetType().Equals(typeof(MapPage))) { BtnOfMap.Relocate(((MapPage)w.main.Content).Prediction_Synthese); } } }
private void Path_MouseDown(object sender, MouseButtonEventArgs e) { if (window1Active) { Prediction_Synthese.Close(); window1Active = false; actualPath.Fill = App.Current.Resources["DarkBlue"] as Brush; actualPath.StrokeThickness = 0.5; actualPath.Stroke = Brushes.White; actualPath.BitmapEffect = null; actualPath = null; } actualPath = (Path)sender; window1Active = true; actualPath.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#75BAC8")); DropShadowBitmapEffect dropShadow = new DropShadowBitmapEffect(); dropShadow.Direction = 270; dropShadow.Color = Colors.White; dropShadow.Opacity = 0.8; dropShadow.ShadowDepth = 3; dropShadow.Softness = 0; actualPath.BitmapEffect = dropShadow; Prediction_Synthese.Close(); Point p = Mouse.GetPosition(App.Current.MainWindow); Prediction_Synthese = new BtnOfMap(p.X, p.Y); if (((MainWindow)App.Current.MainWindow).WindowState.Equals(WindowState.Maximized)) { Prediction_Synthese.Left = p.X - 50; Prediction_Synthese.Top = p.Y; } else { Prediction_Synthese.Left = ((MainWindow)App.Current.MainWindow).Left + p.X - 50; Prediction_Synthese.Top = ((MainWindow)App.Current.MainWindow).Top + p.Y; } Prediction_Synthese.Show(); }