public AccountsWindow(Customer customer, IAccountRepository accountRepository, IAccountValidator accountValidator, IWindowDialogService windowDialogService) { InitializeComponent(); }
public CustomersWindow(ICustomerRepository customerRepository, ICustomerValidator customerValidator, ICityRepository cityRepository, IWindowDialogService windowDialogService) { InitializeComponent(); }
public MainViewModel(IEventAggregator eventAggregator, IWindowDialogService dialogService, IConfirmDialogService confirmService, IRegionManager regionManager) { NavigationDetails = new Dictionary<string, NavigationDetails> { { "Event Query", new NavigationDetails { SubNavigationPath = "/EventQuerySubView", MainPath = "/EventQueryMainView" } }, { "Data Maintenance", new NavigationDetails { SubNavigationPath = "/DataMaintenanceSubView", MainPath = "/DataMaintenanceMainView" } } }; ShowView = new DelegateCommand<string>(OnShowExecuted); ExitCommand = new DelegateCommand(OnExit); _regionManager = regionManager; _eventAggregator = eventAggregator; _dialogService = dialogService; _confirmService = confirmService; // Subscribe to user notification messages that we need to display _eventAggregator.GetEvent<UserNotificationEvent>().Subscribe(DisplayUserMessage); _eventAggregator.GetEvent<UserConfirmationEvent>().Subscribe(DisplayUserConfirmation); _eventAggregator.GetEvent<BusyStartedEvent>().Subscribe(BusyStarted); _eventAggregator.GetEvent<BusyFinishedEvent>().Subscribe(BusyFinished); }
public AccountsWindow(Customer customer, IAccountService accountService, IWindowDialogService windowDialogService) { InitializeComponent(); TypeComboBox.SelectedIndex = 0; }
/// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary> public ConfigureViewModel(SettingsService settings, IUIService ui, IWindowDialogService dialog) { Settings = settings; UI = ui; Dialogs = dialog; }
public CustomersWindow(ICustomerRepository customerRepository, ICityRepository cityRepository, IWindowDialogService windowDialogService) { InitializeComponent(); currentRepository = customerRepository; CustomersDataGrid.DataContext = currentRepository.GetAll(); CityComboBoxColumn.ItemsSource = cityRepository.GetAll(); service = windowDialogService; }
public AccountsWindow(Customer customer, IAccountRepository accountRepository, IWindowDialogService windowDialogService) { InitializeComponent(); this.Title = customer.FirstName.ToString() + " " + customer.Name.ToString(); currentAccountRep = accountRepository; currentCustomer = customer; service = windowDialogService; AccountsDataGrid.DataContext = currentAccountRep.GetAllAccountsOfCustomer(customer.CustomerId); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(SettingsService settings, ScanningService scanning, IIconCacheService iconCache, IUIService ui, IBitmapFactory bitmapFactory, ImagesServiceBase images, IClipboardService clipboard, IOSService os, IWindowDialogService dialogs, TreemapRendererFactory treemapFactory, IShortcutsService shortcuts, RelayCommandService relayFactory) { Settings = settings; Scanning = scanning; IconCache = iconCache; UI = ui; BitmapFactory = bitmapFactory; Images = images; Clipboard = clipboard; OS = os; Dialogs = dialogs; Shortcuts = shortcuts; Treemap = treemapFactory.Create(); Settings.PropertyChanged += OnSettingsPropertyChanged; Scanning.PropertyChanged += OnScanningPropertyChanged; Extensions = new ExtensionItemViewModelCollection(this); SelectedFiles = new ObservableCollection <FileItemViewModel>(); SelectedFiles.CollectionChanged += OnSelectedFilesChanged; FileComparer = new FileComparer(); ExtensionComparer = new ExtensionComparer(); UpdateEmptyRecycleBin(); GCRAMUsage = GC.GetTotalMemory(false); if (IsInDesignMode) { // Code runs in Blend --> create design time data. } else { // Code runs "for real" ramTimer = UI.StartTimer(Settings.RAMInterval, true, OnRAMUsageTick); statusTimer = UI.CreateTimer(Settings.StatusInterval, true, OnStatusTick); } }
/// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary> public DriveSelectViewModel(SettingsService settings, IUIService ui, IWindowDialogService dialog, IIconCacheService iconCache, ScanningService scanning) { Settings = settings; UI = ui; Dialogs = dialog; IconCache = iconCache; Scanning = scanning; Drives = new DriveItemViewModelCollection(this); DriveComparer = new DriveComparer(); SelectedDrives = new ObservableCollection <DriveItemViewModel>(); SelectedDrives.CollectionChanged += OnSelectedDrivesChanged; }
public MainViewModel() { _windowDialogService = new WindowDialogService(); _initDataCommand = new Lazy <RelayCommand>(() => new RelayCommand(InvokeOpenInitDialog)); }
private void InitializeWindow(ICustomerRepository customerRepository, ICityRepository cityRepository, IWindowDialogService windowDialogService) { _window = new CustomersWindow(customerRepository, cityRepository, windowDialogService); _window.Show(); _datagrid = _window.FindVisualChildren <DataGrid>().FirstOrDefault(); _addCustomerButton = _window.GetPrivateFieldValueByName <Button>("AddCustomerButton"); _saveCustomerButton = _window.GetPrivateFieldValueByName <Button>("SaveCustomerButton"); _showAccountsButton = _window.GetPrivateFieldValueByName <Button>("ShowAccountsButton"); }
private void InitializeWindow(Customer customer, IAccountRepository accountRepository, IWindowDialogService windowDialogService) { _window = new AccountsWindow(customer, accountRepository, windowDialogService); _window.Show(); _datagrid = _window.FindVisualChildren <DataGrid>().FirstOrDefault(); _addAccountButton = _window.GetPrivateFieldValueByName <Button>("AddAccountButton"); _saveAccountButton = _window.GetPrivateFieldValueByName <Button>("SaveAccountButton"); _transferButton = _window.GetPrivateFieldValueByName <Button>("TransferButton"); }