public AppWindow(MyFlightSimulatorModel model, MainWindow main, IVM vm) { InitializeComponent(); // initializing the main wondow fields and the vm field this._main = main; this.vm = vm; // creating the view model of the dashboard DashboardVM dashboardVM = new DashboardVM(model); myDashboard.DataContext = dashboardVM; // creating the view model of the map MapVM mapVM = new MapVM(model); myMap.DataContext = mapVM; // creating the view model of the joystick JoystickVM joystickVm = new JoystickVM(model); myControlPlane.DataContext = joystickVm; myControlPlane.myJoystick.DataContext = joystickVm; // creating the view model of the dashboard errors myDashboardErrors.DataContext = dashboardVM; }
/*public double Elevator * { * get * { * return Convert.ToDouble(GetValue(ElevatorProp)); * } * * set * { * SetValue(ElevatorProp, value); * } * } * * public double Aileron * { * get * { * return Convert.ToDouble(GetValue(AileronProp)); * } * * set * { * SetValue(AileronProp, value); * } * } * */ /*public static readonly DependencyProperty ElevatorProp = DependencyProperty.Register("Elevator", typeof(double), typeof(Joystick), null); * * public static readonly DependencyProperty AileronProp = DependencyProperty.Register("Aileron", typeof(double), typeof(Joystick), null);*/ /*private Point start; * private double totalWidth, totalHeight; * private readonly Storyboard cb; * * private bool pressed = false;*/ public Joystick() { InitializeComponent(); this.joystick = new JoystickVM(new JoystickM()); DataContext = joystick; joystick.startflightSpecifiecJoystickMode(); // cb = Knob.Resources["CenterKnob"] as Storyboard; }
public MainWindow() { InitializeComponent(); TcpClient telnetClient = new TcpClient(); myModel = new Model(telnetClient); joystickVM = new JoystickVM(myModel); this.DataContext = joystickVM; }