Microscopic Traffic Simulator
BottomPanelUserControl.xaml.cs
Go to the documentation of this file.
1 using System.Windows;
2 using System.Windows.Controls;
3 
4 namespace Microscopic_Traffic_Simulator.Views.MainWindowView
5 {
9  public partial class BottomPanelUserControl : UserControl
10  {
15  {
16  InitializeComponent();
17  }
18 
24  private void zoomSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
25  {
26  if (e.NewValue != e.OldValue)
27  {
28  MainWindow window = (Window.GetWindow(this) as MainWindow);
29  if (window != null)
30  {
31  double pixelsPerMeter = window.canvasUserControl.Zoomer.UpdatePixelsPerMeter((int)e.NewValue,
32  window.canvasUserControl.topologyCanvas.ActualWidth,
33  window.canvasUserControl.topologyCanvas.ActualHeight);
34  zoomRateSlider.Content = string.Format("{0}x", pixelsPerMeter.ToString("0.###"));
35  }
36  }
37  }
38  }
39 }