Пример #1
0
 public JoyStickView()
 {
     this.vm = new JoyStickViewModel(PlaneModel.GetModel());
     InitializeComponent();
     vm.PropertyChanged += AileronChanged;
     vm.PropertyChanged += ElevatorChanged;
 }
Пример #2
0
        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;
        }