/// <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; } }
public EventsController(IPresentContext context) { _context = context; if (context.PresentArgs is PresentArgs <ControllerEvents> pa) { _throwOnEvent = pa.Value; } if (_throwOnEvent == ControllerEvents.Ctor) { throw new InvalidOperationException(); } }
/// <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); } }
public TimerController(IPresentContext context) { _context = context; _context.Schedule(OnTimer, 0.1f); }
public TagController(IPresentContext context) { _context = context; }
/// <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(); }
/// <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) { }
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) { }