Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ViewController"/> class.
        /// </summary>
        /// <param name="context">A controller context.</param>
        /// <exception cref="ArgumentNullException">Thrown if the <paramref name="context"/> is <see langword="null"/>.</exception>
        protected ViewController(IPresentContext context)
        {
            _context = context ?? throw new ArgumentNullException(nameof(context));

            if (_context.View is INotifyCommand nc)
            {
                nc.Command += OnCommand;
            }
        }
Example #2
0
        public EventsController(IPresentContext context)
        {
            _context = context;

            if (context.PresentArgs is PresentArgs <ControllerEvents> pa)
            {
                _throwOnEvent = pa.Value;
            }

            if (_throwOnEvent == ControllerEvents.Ctor)
            {
                throw new InvalidOperationException();
            }
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageBoxController"/> class.
        /// </summary>
        public MessageBoxController(IPresentContext <MessageBoxResult> context, MessageBoxArgs args)
        {
            _context = context;

            if (context.View is INotifyCommand nc)
            {
                nc.Command += OnCommand;
            }

            if (context.View is IConfigurable <MessageBoxArgs> c)
            {
                c.Configure(args);
            }
        }
Example #4
0
 public TimerController(IPresentContext context)
 {
     _context = context;
     _context.Schedule(OnTimer, 0.1f);
 }
Example #5
0
 public TagController(IPresentContext context)
 {
     _context = context;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppController"/> class.
 /// </summary>
 public AppController(IPresentContext context)
     : base(context)
 {
     // TODO: Initialize the controller view here. Add arguments to the Configure() as needed.
     View.Configure();
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewController{TView}"/> class.
 /// </summary>
 /// <param name="context">A controller context.</param>
 /// <exception cref="ArgumentNullException">Thrown if the <paramref name="context"/> is <see langword="null"/>.</exception>
 protected ViewController(IPresentContext context)
     : base(context)
 {
 }
Example #8
0
 public SplashController(IPresentContext context)
     : base(context)
 {
     context.Schedule(OnTimer, 5);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewController{TView, TResult}"/> class.
 /// </summary>
 /// <param name="context">A controller context.</param>
 /// <exception cref="ArgumentNullException">Thrown if the <paramref name="context"/> is <see langword="null"/>.</exception>
 protected ViewController(IPresentContext <TResult> context)
     : base(context)
 {
 }