Esempio n. 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ContainerBuilder containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterType <MainWindowController>().As <IMainWindowController>();
            containerBuilder.RegisterGeneric(typeof(Repository <>)).As(typeof(IRepository <>));
            containerBuilder.RegisterType <Genre>().As <IGenre>();
            containerBuilder.RegisterType <Movie>().As <IMovie>();
            containerBuilder.RegisterType <AddGenreViewModel>().As <IAddGenreViewModel>();
            containerBuilder.RegisterType <AddMovieViewModel>().As <IAddMovieViewModel>();
            containerBuilder.RegisterType <GenreViewModel>().As <IGenreViewModel>();
            containerBuilder.RegisterType <MainWindowViewModel>().As <IMainWindowViewModel>();
            containerBuilder.RegisterType <MovieViewModel>().As <IMovieViewModel>();
            containerBuilder.RegisterType <AddGenreViewController>().As <IAddGenreViewController>();
            containerBuilder.RegisterType <AddMovieViewController>().As <IAddMovieViewController>();
            containerBuilder.RegisterType <GenresViewController>().As <IGenreViewController>();
            containerBuilder.RegisterType <MoviesViewController>().As <IMovieViewController>();

            Container = containerBuilder.Build();

            IMainWindowController mainController = Container.Resolve <IMainWindowController>();

            mainController.Initialize(Container.Resolve <IRepository <IMovie> >(new NamedParameter("databaseFile", @"Database/Movies.db")),
                                      Container.Resolve <IRepository <IGenre> >(new NamedParameter("databaseFile", @"Database/Movies.db")), false);
        }
Esempio n. 2
0
        public MainWindowViewModel(IMainWindowController controller)
        {
            controller.ViewModel = this;

            Budgets           = new ObservableCollection <Budget>();
            GetBudgetsCommand = new DelegateCommand(controller.OnGetBudgets);
        }
Esempio n. 3
0
        public MainWindowViewModel(IMainWindowController controller)
        {
            controller.ViewModel = this;

            Budgets = new ObservableCollection<Budget>();
            GetBudgetsCommand = new DelegateCommand(controller.OnGetBudgets);
        }
Esempio n. 4
0
        public MainWindow(IMainWindowController candyShopController)
        {
            Controller = candyShopController;
            InitializeComponent();

            Text = String.Format(LocaleEN.TEXT_APP_TITLE, Application.ProductName, Application.ProductVersion);
        }
Esempio n. 5
0
        static void Main()
        {
            App app = new App();
            IMainWindowController controller = WindowControllerFactory.GetMainWindowController();

            app.Run(controller.GetAttachedWindow().GetAsWindow());
        }
Esempio n. 6
0
        public ViewModelLogin(IEnterValidationRule enterValidationRule, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient)
        {
            this.validatablePropertyCollection.Add("Login");
            this.validatablePropertyCollection.Add("Password");

            this.enterValidationRule  = enterValidationRule;
            this.mainWindowController = mainWindowController;
            this.frontServiceClient   = frontServiceClient;
        }
Esempio n. 7
0
        public ViewModelFactory(IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient)
        {
            _mainWindowController = mainWindowController;
            _frontServiceClient   = frontServiceClient;

            _viewModelCollection.Add(typeof(LoginViewModel), new LoginViewModel(_mainWindowController, frontServiceClient));
            _viewModelCollection.Add(typeof(RegisterViewModel), new RegisterViewModel(_mainWindowController, frontServiceClient));
            _viewModelCollection.Add(typeof(DashboardViewModel), new DashboardViewModel(_mainWindowController, frontServiceClient));
        }
Esempio n. 8
0
        public ViewModelReport(IReportValidationRule reportValidationRule, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient, User user)
        {
            this.validatablePropertyCollection.Add("SinceDate");
            this.validatablePropertyCollection.Add("ToDate");

            this.reportValidationRule = reportValidationRule;
            this.mainWindowController = mainWindowController;
            this.frontServiceClient   = frontServiceClient;
            this.user = user;
        }
Esempio n. 9
0
        public void InstallViewController(IMainWindowController theController)
        {
            MenuCommands = new ObservableCollection <CommandDescriptor>(theController.GetMenuCommands());

            Colors        = new ObservableCollection <ColorDescription>(theController.GetColors());
            SelectedColor = Colors.First();

            LineWidths        = new ObservableCollection <LineWidthDescription>(theController.GetLineDescriptions());
            SelectedLineWidth = LineWidths.First();
        }
Esempio n. 10
0
        public ViewModelMain(IProductByDateValidationRule productByDateValidationRule, ISaleByDateValidationRule saleByDateValidationRule, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient, User user)
        {
            this.validatablePropertyCollection.Add("SinceDate");
            this.validatablePropertyCollection.Add("ToDate");

            this.productByDateValidationRule = productByDateValidationRule;
            this.saleByDateValidationRule    = saleByDateValidationRule;
            this.mainWindowController        = mainWindowController;
            this.frontServiceClient          = frontServiceClient;
            this.user = user;
        }
Esempio n. 11
0
 /// <summary>
 /// Creates a new instance of <see cref="StorageCommandHandler"/>.
 /// </summary>
 /// <param name="projectStorage">Class responsible to storing and loading the application project.</param>
 /// <param name="projectMigrator">Class responsible for the migration of the application projects.</param>
 /// <param name="projectFactory">The factory to use when creating new projects.</param>
 /// <param name="projectOwner">The class owning the application project.</param>
 /// <param name="inquiryHelper">The object facilitating user interaction.</param>
 /// <param name="mainWindowController">The object owning the parent controller for UI.</param>
 public StorageCommandHandler(IStoreProject projectStorage, IMigrateProject projectMigrator,
                              IProjectFactory projectFactory, IProjectOwner projectOwner,
                              IInquiryHelper inquiryHelper, IMainWindowController mainWindowController)
 {
     projectPersister          = projectStorage;
     this.projectMigrator      = projectMigrator;
     this.projectFactory       = projectFactory;
     this.projectOwner         = projectOwner;
     this.inquiryHelper        = inquiryHelper;
     this.mainWindowController = mainWindowController;
 }
Esempio n. 12
0
        public ViewModelSale(ISaleValidationRule saleValidationRule, IProductValidationRule productValidationRule, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient, Seller seller, User user)
        {
            this.validatablePropertyCollection.Add("Product");
            this.validatablePropertyCollection.Add("Count");
            this.validatablePropertyCollection.Add("Datetime");

            this.saleValidationRule    = saleValidationRule;
            this.productValidationRule = productValidationRule;
            this.mainWindowController  = mainWindowController;
            this.frontServiceClient    = frontServiceClient;
            this.seller = seller;
            this.user   = user;
        }
Esempio n. 13
0
        public ViewModelProduct(IArrivedGoodsValidationRule arrivedGoodsValidationRule, IProductValidationRule productValidationRule, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient, ArrivedGoods arrivedGoods, Product product, Seller seller, User user, int id)
        {
            this.validatablePropertyCollection.Add("Unit");
            this.validatablePropertyCollection.Add("Count");
            this.validatablePropertyCollection.Add("Datetime");
            this.validatablePropertyCollection.Add("ExpirationDate");
            this.validatablePropertyCollection.Add("PurchasePrice");
            this.validatablePropertyCollection.Add("SalesPrice");
            this.validatablePropertyCollection.Add("ReturnedDate");

            this.arrivedGoodsValidationRule = arrivedGoodsValidationRule;
            this.productValidationRule      = productValidationRule;
            this.mainWindowController       = mainWindowController;
            this.frontServiceClient         = frontServiceClient;
            this.seller       = seller;
            this.product      = product;
            this.arrivedGoods = arrivedGoods;
            this.user         = user;
            this.id           = id;
        }
Esempio n. 14
0
 /// <summary>
 /// Saves the handle to the controller for the MainWindow
 /// </summary>
 /// <param name="mainWindowController"></param>
 public void AttachMainWindowController(IMainWindowController mainWindowController)
 {
     MainWindowController = mainWindowController;
 }
Esempio n. 15
0
 public AddMovieWindow(IMainWindowController mwc)
 {
     InitializeComponent();
     _mwc = mwc;
 }
Esempio n. 16
0
 private async Task StartChildControllers()
 {
     _mainWindowController            = new KernelWrapper().Get <IMainWindowController>();
     _mainWindowController.MainWindow = _mainWindow;
     await _mainWindowController.StartControllerAsync();
 }
Esempio n. 17
0
 /// <summary>
 /// Constructs the MainWindow view.
 /// </summary>
 /// <param name="operate">Operation handler for MainWindowController</param>
 public MainWindow(IMainWindowController mwc)
 {
     InitializeComponent();
     _mwc = mwc;     // Store MainWindowController
     InitializeUx(); // Initialize Ux
 }
Esempio n. 18
0
 public ViewModelFactory(IValidationRuleFactory validationRuleFactory, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient)
 {
     this.validationRuleFactory = validationRuleFactory;
     this.mainWindowController  = mainWindowController;
     this.frontServiceClient    = frontServiceClient;
 }
Esempio n. 19
0

        
Esempio n. 20
0

        
Esempio n. 21
0
 public AddProductController(RichTextBox outputTextField, IMainWindowController Main)
 {
     this.Main = Main;
     AddLogic  = new AddProductLogic();
     output    = outputTextField;
 }
Esempio n. 22
0
 public ModifyAccountWindow(IMainWindowController mwc, AccountSelector GetSelectedAccount)
 {
     InitializeComponent();
     _mwc = mwc;
     _GetSelectedAccount = GetSelectedAccount;
 }
Esempio n. 23
0
 public CreateAccountWindow(IMainWindowController mwc)
 {
     InitializeComponent();
     _mwc = mwc;
 }
Esempio n. 24
0
 public DashboardViewModel(IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient) :
     base(mainWindowController, frontServiceClient)
 {
 }
Esempio n. 25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="mwc">Delegate to handle operations</param>
 public BrowseMovieWindow(IMainWindowController mwc)
 {
     InitializeComponent();
     _mwc = mwc;
     uxButtonGetMovie.Enabled = false;
 }