Ejemplo n.º 1
0
        public ApplicationController(IEnvironmentService environmentService, IPresentationService presentationService, ShellService shellService,
            Lazy<FileController> fileController, Lazy<RichTextDocumentController> richTextDocumentController, Lazy<PrintController> printController,
            Lazy<ShellViewModel> shellViewModel, Lazy<MainViewModel> mainViewModel, Lazy<StartViewModel> startViewModel)
        {
            // Upgrade the settings from a previous version when the new version starts the first time.
            if (Settings.Default.IsUpgradeNeeded)
            {
                Settings.Default.Upgrade();
                Settings.Default.IsUpgradeNeeded = false;
            }

            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            InitializeCultures();
            presentationService.InitializeCultures();

            this.environmentService = environmentService;
            this.fileController = fileController.Value;
            this.richTextDocumentController = richTextDocumentController.Value;
            this.printController = printController.Value;
            this.shellViewModel = shellViewModel.Value;
            this.mainViewModel = mainViewModel.Value;
            this.startViewModel = startViewModel.Value;

            shellService.ShellView = this.shellViewModel.View;
            this.shellViewModel.Closing += ShellViewModelClosing;
            this.exitCommand = new DelegateCommand(Close);
        }
        public ApplicationController(CompositionContainer container, IEnvironmentService environmentService,
            IPresentationService presentationService, ShellService shellService, FileController fileController)
        {
            InitializeCultures();
            presentationService.InitializeCultures();

            this.environmentService = environmentService;
            this.fileController = fileController;

            this.solutionDocumentController = container.GetExportedValue<SolutionDocumentController>();
            this.shellViewModel = container.GetExportedValue<ShellViewModel>();
            this.mainViewModel = container.GetExportedValue<MainViewModel>();
            this.startViewModel = container.GetExportedValue<StartViewModel>();

            shellService.ShellView = shellViewModel.View;
            this.shellViewModel.Closing += ShellViewModelClosing;
            this.exitCommand = new DelegateCommand(Close);
        }
Ejemplo n.º 3
0
 public StartPage()
 {
     this.InitializeComponent();
     this.DataContext = StartVM = new StartViewModel();
 }
Ejemplo n.º 4
0
 static UserController()
 {
     model   = new StartViewModel();
     service = new Service("~/App_Data/questions.xml");
 }
Ejemplo n.º 5
0
 public StartPage()
 {
     InitializeComponent();
     viewModel   = new StartViewModel();
     DataContext = viewModel;
 }
Ejemplo n.º 6
0
 public StartView()
 {
     InitializeComponent();
     BindingContext = new StartViewModel();
     NavigationPage.SetHasNavigationBar(this, false);
 }
Ejemplo n.º 7
0
        public StartPage()
        {
            InitializeComponent();

            BindingContext = new StartViewModel(Navigation);
        }
Ejemplo n.º 8
0
 public StartPage(StartViewModel _vm)
 {
     DataContext       = _vm;
     _vm.CloseHandler += (sender, args) => { this.Close(); };
     InitializeComponent();
 }
 public UpdateDatabasePage()
 {
     InitializeComponent();
     _vm = DataContext as StartViewModel;
 }
Ejemplo n.º 10
0
 public StartWindow()
 {
     InitializeComponent();
     //CreateTestData();
     DataContext = viewModel = new StartViewModel();
 }
Ejemplo n.º 11
0
        public IActionResult Index()
        {
            var model = new StartViewModel();

            return(View("Index", model));
        }
Ejemplo n.º 12
0
 public MainViewModel()
 {
     _instance    = this;
     this.StartVM = new StartViewModel();
 }
Ejemplo n.º 13
0
 public MainViewModel()
 {
     ViewName  = "Кошелёк";
     ViewModel = new StartViewModel();
 }
Ejemplo n.º 14
0
 public StartView(StartViewModel viewModel)
 {
     InitializeComponent();
     this.viewModel = viewModel;
     DataContext = this.viewModel;
 }
Ejemplo n.º 15
0
 public StartPage()
 {
     InitializeComponent();
     _vm     = DataContext as StartViewModel;
     Loaded += StartPage_Loaded;
 }
Ejemplo n.º 16
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            StartViewModel s = DataContext as StartViewModel;

            s.Client.Save();
        }
Ejemplo n.º 17
0
 public StartPage()
 {
     this.InitializeComponent();
     viewModel    = new StartViewModel();
     this.Loaded += StartPage_Loaded;
 }
Ejemplo n.º 18
0
 public Start(IConnectionService connectionService)
 {
     InitializeComponent();
     BindingContext = new StartViewModel(connectionService);
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Application.Startup"/> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs"/> that contains the event data.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(System.Windows.Markup.XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            Thread.CurrentThread.Name = "MainThread";

            base.OnStartup(e);

            // Init logger
            log4net.Config.XmlConfigurator.Configure();

            // Register handler for unhandled exceptions
            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(this.App_DispatcherUnhandledException);

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException);

            // Build
            var mainViewModel = new MainViewModel();

            this.startViewModel = new StartViewModel();
            var scanViewModel               = new ScanViewModel();
            var previewViewModel            = new PreviewViewModel();
            var previewNoFilesViewModel     = new PreviewNoFilesViewModel();
            var synchronizeViewModel        = new SynchronizeViewModel();
            var synchronizeNoFilesViewModel = new SynchronizeNoFilesViewModel();
            var resultViewModel             = new ResultViewModel();

            var synchronizer = new Synchronizer(new FileLogger());

            var startAction              = new StartAction();
            var scanAction               = new ScanAction(synchronizer);
            var previewAction            = new PreviewAction();
            var previewNoFilesAction     = new PreviewNoFilesAction();
            var synchronizeNoFilesAction = new SynchronizeNoFilesAction();
            var synchronizeAction        = new SynchronizeAction(synchronizer);
            var resultAction             = new ResultAction();

            var mainWindow = new MainWindow();

            // Bind
            startAction.Synchronize += scanAction.Process;

            scanAction.Preview        += previewAction.Process;
            scanAction.PreviewNoFiles += previewNoFilesAction.Process;
            scanAction.Canceled       += startAction.Process;

            previewAction.Synchronize        += synchronizeAction.Process;
            previewAction.SynchronizeNoFiles += synchronizeNoFilesAction.Process;
            previewAction.Canceled           += startAction.Process;

            previewNoFilesAction.Ok += startAction.Process;

            synchronizeAction.Result += resultAction.Process;

            synchronizeNoFilesAction.Ok += startAction.Process;

            resultAction.Ok += startAction.Process;

            // Inject
            startAction.Inject(mainViewModel);
            startAction.Inject(this.startViewModel);
            scanAction.Inject(mainViewModel);
            scanAction.Inject(scanViewModel);
            previewAction.Inject(mainViewModel);
            previewAction.Inject(previewViewModel);
            previewNoFilesAction.Inject(mainViewModel);
            previewNoFilesAction.Inject(previewNoFilesViewModel);
            synchronizeNoFilesAction.Inject(mainViewModel);
            synchronizeNoFilesAction.Inject(synchronizeNoFilesViewModel);
            synchronizeAction.Inject(mainViewModel);
            synchronizeAction.Inject(synchronizeViewModel);
            resultAction.Inject(mainViewModel);
            resultAction.Inject(this.startViewModel);
            resultAction.Inject(resultViewModel);

            mainWindow.Inject(mainViewModel);

            // Run
            this.startViewModel.LoadDefaultJobList();

            this.MainWindow = mainWindow;
            startAction.Process();
            this.MainWindow.Show();
        }
Ejemplo n.º 20
0
 public StartCommand(StartViewModel model)
 {
     viewModel = model;
 }
Ejemplo n.º 21
0
 public StartView(StartViewModel viewModel)
 {
     InitializeComponent();
     this.viewModel = viewModel;
     DataContext    = this.viewModel;
 }
Ejemplo n.º 22
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new StartViewModel(this);
 }
Ejemplo n.º 23
0
 public StartView()
 {
     InitializeComponent();
     _viewModel = ViewModelSource.Create <StartViewModel>();
 }
Ejemplo n.º 24
0
 public StartPage()
 {
     InitializeComponent();
     this.Loaded += StartPage_Loaded;
     DataContext  = new StartViewModel();
 }
Ejemplo n.º 25
0
 public StartPage(StartViewModel model)
 {
     InitializeComponent();
     DataContext = model;
 }
Ejemplo n.º 26
0
        public void GetFileService()
        {
            StartViewModel startViewModel = Container.GetExportedValue <StartViewModel>();

            Assert.IsNotNull(startViewModel.FileService);
        }
Ejemplo n.º 27
0
 private void ButtonStart_Click(object sender, RoutedEventArgs e)
 {
     DataContext = new StartViewModel();
 }
Ejemplo n.º 28
0
 public StartView()
 {
     InitializeComponent();
     BindingContext = new StartViewModel();
 }
Ejemplo n.º 29
0
 public StartScreen(Navigator navigator) : base(navigator)
 {
     VM    = new StartViewModel();
     Start = new EasyCommand(() => SwitchTo(new GameScreen(navigator, VM.SelectedPuzzle.Puzzle)));
 }
Ejemplo n.º 30
0
 public Start()
 {
     InitializeComponent();
     DataContext = new StartViewModel();
 }
Ejemplo n.º 31
0
 public StartWindow()
 {
     DataContext = new StartViewModel();
     InitializeComponent();
 }