public MonitorViewModel(
            Control view,
            IComponentViewModel viewModel,
            IRaceViewModel parent)
        {
            this.View      = view ?? throw new ArgumentNullException();
            this.Parent    = parent ?? throw new ArgumentNullException();
            this.ViewModel = viewModel ?? throw new ArgumentNullException();

            this.View.DataContext = viewModel;
        }
Exemple #2
0
        public RaceListViewModel(IRaceViewModel parent)
        {
            this.Parent = parent ?? throw new ArgumentNullException();

            this.NewCommandViewModel = new CommandViewModel(
                "New",
                "Create a new race",
                () => this.Parent.NewAsync());

            this.StopRaceCommandViewModel = new CommandViewModel(
                "Stop race",
                "Stop race",
                () => this.Parent.StopRaceAsync(),
                () => this.Parent.CanStopRaceAsync(),
                withStyle: ButtonStyle.Flat);
        }
Exemple #3
0
 public RaceDetailViewModel(IRaceViewModel parent)
 {
     this.Parent = parent;
     this.UpdateNavigationTabs();
 }