public JoyStickView() { this.vm = new JoyStickViewModel(PlaneModel.GetModel()); InitializeComponent(); vm.PropertyChanged += AileronChanged; vm.PropertyChanged += ElevatorChanged; }
public Joystick() { InitializeComponent(); joystickVM = new JoyStickViewModel(FlightManagerModel.Instance); DataContext = joystickVM; //the canvas name of the joystick is Knob Knob.MouseLeftButtonDown += Knob_MouseLeftButtonDown; Knob.MouseLeftButtonUp += Knob_MouseLeftButtonUp; Knob.MouseMove += Knob_MouseMove; centerKnob = Knob.Resources["CenterKnob"] as Storyboard; }