public AutoPilot()
        {
            InitializeComponent();
            AutoPilotViewModel APVM = new AutoPilotViewModel(ApplicationModel.Instance);

            this.DataContext = APVM;
        }
Example #2
0
 public AutoPilot()
 {
     //set context to view model
     viewModel        = new AutoPilotViewModel();
     this.DataContext = viewModel;
     InitializeComponent();
 }
Example #3
0
        public AutoPilot()
        {
            InitializeComponent();
            vm          = new AutoPilotViewModel(new AutoPilotModel());
            DataContext = vm;
            //this is the exact color from the instructions
            customLightRed = (Brush) new BrushConverter().ConvertFrom("#FFB6C1");

            vm.PropertyChanged += delegate(object sender, System.ComponentModel.PropertyChangedEventArgs e)
            {
                /* if the user is typing, that means that the text has been changed, thus the background should
                 * change to light red, otherwise it should be white */
                if (e.PropertyName.Equals("IsTyping"))
                {
                    if (vm.IsTyping)
                    {
                        textBox.Background = customLightRed;
                    }
                    else
                    {
                        textBox.Background = Brushes.White;
                    }
                }
            };
        }
        public AutoPilot()
        {
            InitializeComponent();
            AutoPilotViewModel autoViewModel = new AutoPilotViewModel();

            DataContext = autoViewModel;
        }
Example #5
0
        private AutoPilotViewModel vm;          // auto pilot view model instance

        /**
         *  the constructor creates presentation of AutoPilot Control based on the xaml code
         *  and initialized his properties
         **/
        public AutoPilotControl()
        {
            InitializeComponent();
            vm = new AutoPilotViewModel();
            /* changes the data context to view model */
            DataContext = vm;
        }
        public AutoPilot()
        {
            InitializeComponent();

            AutoPilotViewModel AutoPilotVM = new AutoPilotViewModel();

            DataContext = AutoPilotVM;
        }
 public AutoPilot()
 {
     // Intialize the component
     InitializeComponent();
     // Initialize the view model.
     viewModel   = new AutoPilotViewModel();
     DataContext = viewModel;
 }
 public void SendCommands(string input, AutoPilotViewModel vm)
 {
     // open new thread to avoid idle
     new Thread(delegate()
     {
         Commands.Instance.SendCommands(input);
         vm.Background = Brushes.White;
     }).Start();
 }
 public Auto()
 {
     InitializeComponent();
     autoPilotView = new AutoPilotViewModel();
     DataContext   = autoPilotView;
     if (autoPilotView.WhiteBackgroundAction == null)
     {
         autoPilotView.WhiteBackgroundAction = new Action(() => TextBox.Background = Brushes.White);
     }
 }
Example #10
0
        public AutoPilot()
        {
            // init
            InitializeComponent();
            DataContext = this.vm = new AutoPilotViewModel();

            // while script wasn't sent, textbox is pink
            //  this.colorfullTextBox.Background = Brushes.Pink;

            /*     if (vm.makeRed == null)
             *   {
             *       vm.makeRed = new Action(() => this.colorfullTextBox.Background = Brushes.Pink);
             *   }
             *   if (vm.makeWhite == null)
             *   {
             *       vm.makeWhite = new Action(() => this.colorfullTextBox.Background = Brushes.WhiteSmoke);
             *   }*/
        }
Example #11
0
        //CTOR
        public MainWindow()
        {
            InitializeComponent();
            IMainWinModel m = new MainWinMod(AutoPilotBox);

            vm = new ManuelPilotViewModel(m, joystick);
            FlightBoardViewModel fvm = new FlightBoardViewModel(m);
            AutoPilotViewModel   avm = new AutoPilotViewModel(m);

            osvm                      = new OtherStuffViewModel(m);
            flightBoard.VM            = fvm;
            m.PropertyChanged        += fvm.Model_PropertyChanged;
            joystick.Moved           += vm.JoyStick_Handler;
            this.DataContext          = vm;
            autoPilotButt.DataContext = avm;
            clearButt.DataContext     = avm;
            connectButt.DataContext   = osvm;
            settButt.DataContext      = osvm;
            Application.Current.MainWindow.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
        }
Example #12
0
 public AutoPilot()
 {
     vm = new AutoPilotViewModel(SimulatorModel.Instance);
     InitializeComponent();
     this.DataContext = vm;
 }
Example #13
0
 public AutoPilotView()
 {
     InitializeComponent();
     viewModel   = new AutoPilotViewModel();
     DataContext = viewModel;
 }
Example #14
0
 public AutoPilot()
 {
     InitializeComponent();
     vm          = new AutoPilotViewModel(new AutoPilotModel());
     DataContext = vm;
 }
Example #15
0
 public UC_AutoPilot()
 {
     InitializeComponent();
     DataContext = new AutoPilotViewModel();
 }
Example #16
0
 public AutoPilot()
 {
     InitializeComponent();
     this.viewModel   = new AutoPilotViewModel();
     this.DataContext = this.viewModel;
 }
Example #17
0
 public AutoPilot()
 {
     InitializeComponent();
     DataContext = new AutoPilotViewModel(Commands.Instance);
 }
Example #18
0
 public AutoPilotControlPanel()
 {
     InitializeComponent();
     vm = new AutoPilotViewModel(new AutoPilotModel());
     this.DataContext = vm;
 }
Example #19
0
 public AutoPilotView()
 {
     InitializeComponent();
     VM_AutoPilot = new AutoPilotViewModel();
     DataContext  = VM_AutoPilot;
 }
Example #20
0
 public AutoPilot()
 {
     InitializeComponent();
     autoVM           = new AutoPilotViewModel();
     this.DataContext = autoVM;
 }