The application's graphic interface model.
Inheritance: System.Windows.Window
Ejemplo n.º 1
0
        /// <summary>
        /// This overload of the method Load provides binding for the project exports.
        /// </summary>
        public override void Load()
        {
            var window = new BalloonsView();
            var controller = new MainWindowController(window, new Resources());

            this.AppKernel.Unbind<IEventBasedUserInterface>();
            this.AppKernel.Unbind<IPrinter>();
            this.AppKernel.Bind<IEventBasedUserInterface>().ToMethod(ctx => controller);
            this.AppKernel.Bind<IPrinter>().ToMethod(ctx => controller);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowController" /> class with view and resource provider.
        /// </summary>
        /// <param name="window">The view which the newly created instance is responsible for managing.</param>
        /// <param name="resources">The resource provider which the newly created instance will query for resources.</param>
        public MainWindowController(BalloonsView window, IBalloonsWpfResourceProvider resources)
        {
            this.Window = window;

            this.Resources = resources;

            this.Window.CommandButtons.ForEach(button =>
            {
                button.Value.Click += (s, e) =>
                {
                    this.Window.Raise(s, new UserCommandArgs(button.Key));
                };
            });
        }
Ejemplo n.º 3
0
        public EventEngineTests()
        {
            this.kernel = new StandardKernel();
            this.kernel.Bind<ILogger>().ToMethod(x => LogHelper.GetLogger());
            DependancyBinder.Instance
                .RegisterModules(
                                 new ModelsModule(this.kernel),
                                 new LogicModule(this.kernel),
                                 new ValidationModule(this.kernel),
                                 new WpfCommandModule(this.kernel),
                                 new HighscoreModule(this.kernel),
                                 new SaverModule(this.kernel),
                                 new WpfModule(this.kernel),
                                 new SoundsModule(this.kernel))
                .LoadAll();

            this.bundle = new WpfBundle(this.kernel);
            this.ctx = new Context(this.kernel);
            this.engine = new EventEngine(this.ctx, this.bundle);
            this.view = new BalloonsView();
            this.resources = new Resources();
            this.controller = new MainWindowController(this.view, this.resources);
        }
 public void TestInit()
 {
     this.view = new BalloonsView();
     this.resourceProvider = new Resources();
     this.controller = new MainWindowController(this.view, this.resourceProvider);
 }
Ejemplo n.º 5
0
 public void TestInit()
 {
     this.view = new BalloonsView();
 }