Пример #1
0
        public CommandGenerate(VideoPreviewModel value, SerialPort port, string movie)
        {
            // var res =  GetHexCode("1");
            movieName = movie;
            var list = ConfigureHelper.GetSerialNodeList();

            InitializeComponent();
            videoPreviewModel = value;
            serialPort        = port;
            if (port != null)
            {
                port.DataReceived += SPort_DataReceived;
            }

            this.Loaded += MainWindow_Loaded;
            _viewModel   = new ViewModel.MainViewModel();
            foreach (var item in list)
            {
                _viewModel.Page2ImagemModelList.Add(new Model.Page2ImageModel()
                {
                    Key = item.key, Content = item.Content, IsChecked = false
                });
            }
            if (value.CurrentFlow != null)
            {
                _viewModel.CommandList = new ObservableCollection <Model.Instruction>(value.CurrentFlow.Instructions.Where(u => u.T时间 == value.CurrentPos).ToList());
            }

            this.DataContext = _viewModel;
        }
Пример #2
0
        public MainView()
        {
            InitializeComponent();
            ViewModel.MainViewModel vm = new ViewModel.MainViewModel();
            this.DataContext = vm;

            vm.CloseAction = new Action(() => this.Close());
        }
Пример #3
0
        public MainPage()
        {
            InitializeComponent();

            var vm = new ViewModel.MainViewModel();

            this.BindingContext = vm;
        }
Пример #4
0
        public MainMasterPageMaster()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            BindingContext = new ViewModel.MainViewModel();
            ListView       = MenuItemsListView;
        }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = new ViewModel.MainViewModel()
            {
                //Repository = new Providers.DemoProvider()
                Repository = new Providers.CsvProvider()
                //Repository = new Providers.WebProvider("http://localhost:5866/")
            };
        }
Пример #6
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.New)
            {
                var vm = e.Parameter as MainViewModel;
                cts = new CancellationTokenSource();
                VM  = vm;
                _app.EnterFullScreen();
                Bindings.Update();
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                //fire and forgot
                ListenForProgressChange(cts.Token);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            }
            base.OnNavigatedTo(e);
        }
Пример #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Views.MenuView          menu   = new Views.MenuView();
            ViewModel.MenuViewModel menuVM = new ViewModel.MenuViewModel();
            menuVM.NewGameEvent  += new EventHandler(Menu_New);
            menuVM.LoadGameEvent += new EventHandler(Menu_Load);
            menuVM.QuitGameEvent += new EventHandler(Menu_Quit);
            menu.DataContext      = menuVM;

            _mainViewModel = new ViewModel.MainViewModel(menu);
            _mainWindow    = new View.MainWindow();

            _mainWindow.DataContext = _mainViewModel;
            _mainWindow.Show();
        }
Пример #8
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            ViewModel.MainViewModel mvm = (ViewModel.MainViewModel)DataContext;
            bool result = mvm.CanClosed;

            if (result)
            {
                MessageBoxResult dr = MessageBox.Show("Есть несохраненные элементы. Все равно закрыть?", "Внимание!", MessageBoxButton.YesNo);
                if (dr == MessageBoxResult.Yes)
                {
                    e.Cancel = false;
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }
Пример #9
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = vm = new ViewModel.MainViewModel();
     ViewModel.SynchronisationHelper.RegisterParentWindow(this);
 }
Пример #10
0
 private void MainView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     vm = this.DataContext as ViewModel.MainViewModel;
     vm.PositionChanged += Vm_PositionChanged;
 }
Пример #11
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     this.DataContext = ViewModel = new ViewModel.MainViewModel();
 }
Пример #12
0
 public MainWindow()
 {
     InitializeComponent();
     model            = new ViewModel.MainViewModel();
     this.DataContext = model;
 }
Пример #13
0
 public PageMedia(ViewModel.MainViewModel parent)
 {
     InitializeComponent();
     this.DataContext = new ViewModel.PageMedia(parent);
 }
 public GlobalView(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
 }
Пример #15
0
 public MainWindow()
 {
     InitializeComponent();
     ViewModel.MainViewModel vm = new ViewModel.MainViewModel();
     this.DataContext = vm;
 }
 internal BottomPanel(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
 }
 internal Player(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
 }
Пример #18
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModel.MainViewModel();
 }
Пример #19
0
 internal Hall(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
     mainViewModel.RefreshLastGame();
 }
Пример #20
0
 private void Window_Closed(object sender, EventArgs e)
 {
     ViewModel.MainViewModel mvm = FindResource("mainViewModel") as ViewModel.MainViewModel;
     mvm.FinishWork();
 }
 internal Registration(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
 }
Пример #22
0
        public Accueil(ViewModel.MainViewModel parent)
        {
            InitializeComponent();

            base.DataContext = new ViewModel.Accueil(parent);
        }
Пример #23
0
 public MainPage()
 {
     InitializeComponent();
     BindingContext = new ViewModel.MainViewModel();
     //cargarTablaAsync();
 }
Пример #24
0
 public Locator()
 {
     this.Main = new ViewModel.MainViewModel();
 }
Пример #25
0
 private void MainView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     vm = this.DataContext as ViewModel.MainViewModel;
     vm.GridProjectChanged += Vm_GridProjectChanged;
     selectedItems          = vm.SelectedItems;
 }
Пример #26
0
 public Liste(ViewModel.MainViewModel parent)
 {
     InitializeComponent();
     this.DataContext = new ViewModel.Liste(parent);
 }
 public TreeView()
 {
     InitializeComponent();
     ViewModel.MainViewModel TreeView = new ViewModel.MainViewModel();
     DataContext = new ViewModel.MainViewModel();
 }
Пример #28
0
 internal Authorization(ViewModel.MainViewModel mainViewModel)
 {
     InitializeComponent();
     DataContext = mainViewModel;
 }