Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

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 {
14 public BottomPanelUserControl()
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 }
System
Microscopic_Traffic_Simulator.Views.MainWindowView.MainWindow
MainWindow
Definition: MainWindow.g.cs:43
Microscopic_Traffic_Simulator
Definition: App.xaml.cs:12
Microscopic_Traffic_Simulator.Views.MainWindowView.BottomPanelUserControl.BottomPanelUserControl
BottomPanelUserControl()
Constructor for bottom panel user control.
Definition: BottomPanelUserControl.xaml.cs:14