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); }
public StartPage() { this.InitializeComponent(); this.DataContext = StartVM = new StartViewModel(); }
static UserController() { model = new StartViewModel(); service = new Service("~/App_Data/questions.xml"); }
public StartPage() { InitializeComponent(); viewModel = new StartViewModel(); DataContext = viewModel; }
public StartView() { InitializeComponent(); BindingContext = new StartViewModel(); NavigationPage.SetHasNavigationBar(this, false); }
public StartPage() { InitializeComponent(); BindingContext = new StartViewModel(Navigation); }
public StartPage(StartViewModel _vm) { DataContext = _vm; _vm.CloseHandler += (sender, args) => { this.Close(); }; InitializeComponent(); }
public UpdateDatabasePage() { InitializeComponent(); _vm = DataContext as StartViewModel; }
public StartWindow() { InitializeComponent(); //CreateTestData(); DataContext = viewModel = new StartViewModel(); }
public IActionResult Index() { var model = new StartViewModel(); return(View("Index", model)); }
public MainViewModel() { _instance = this; this.StartVM = new StartViewModel(); }
public MainViewModel() { ViewName = "Кошелёк"; ViewModel = new StartViewModel(); }
public StartView(StartViewModel viewModel) { InitializeComponent(); this.viewModel = viewModel; DataContext = this.viewModel; }
public StartPage() { InitializeComponent(); _vm = DataContext as StartViewModel; Loaded += StartPage_Loaded; }
private void Button_Click(object sender, RoutedEventArgs e) { StartViewModel s = DataContext as StartViewModel; s.Client.Save(); }
public StartPage() { this.InitializeComponent(); viewModel = new StartViewModel(); this.Loaded += StartPage_Loaded; }
public Start(IConnectionService connectionService) { InitializeComponent(); BindingContext = new StartViewModel(connectionService); }
/// <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(); }
public StartCommand(StartViewModel model) { viewModel = model; }
public MainWindow() { InitializeComponent(); DataContext = new StartViewModel(this); }
public StartView() { InitializeComponent(); _viewModel = ViewModelSource.Create <StartViewModel>(); }
public StartPage() { InitializeComponent(); this.Loaded += StartPage_Loaded; DataContext = new StartViewModel(); }
public StartPage(StartViewModel model) { InitializeComponent(); DataContext = model; }
public void GetFileService() { StartViewModel startViewModel = Container.GetExportedValue <StartViewModel>(); Assert.IsNotNull(startViewModel.FileService); }
private void ButtonStart_Click(object sender, RoutedEventArgs e) { DataContext = new StartViewModel(); }
public StartView() { InitializeComponent(); BindingContext = new StartViewModel(); }
public StartScreen(Navigator navigator) : base(navigator) { VM = new StartViewModel(); Start = new EasyCommand(() => SwitchTo(new GameScreen(navigator, VM.SelectedPuzzle.Puzzle))); }
public Start() { InitializeComponent(); DataContext = new StartViewModel(); }
public StartWindow() { DataContext = new StartViewModel(); InitializeComponent(); }