public void SetUp()
 {
     _fakeDialogService   = A.Fake <IDialogService>();
     _fakeDispatcher      = A.Fake <IDispatcher>();
     _fakeBoardControl    = A.Fake <IBoardControl>();
     _mainWindowViewModel = new MainWindowViewModel(_fakeDialogService, _fakeDispatcher, _fakeBoardControl);
 }
        public MainWindowViewModel(IBoardControl boardControl)
        {
            _boardControl = boardControl;
            _solutions = new ObservableCollection<IImmutableList<PlacedTetraStick>>();
            TetraStickToOmit = TetraSticksToOmit.First();

            _timer.Tick += (_, __) => OnTick();
            _timer.Interval = TimeSpan.FromMilliseconds(50);
            _timer.Start();
        }
示例#3
0
        public MainWindowViewModel(IDialogService dialogService, IDispatcher dispatcher, IBoardControl boardControl)
        {
            _dialogService             = dialogService;
            _dispatcher                = dispatcher;
            _boardControl              = boardControl;
            _boardControl.CellClicked += (_, e) => CellClicked(e.Coords);

            GridDescriptions  = SampleGrids.SampleGridDescriptions;
            DotColours        = Model.DotColours.Colours;
            SelectedGrid      = GridDescriptions.First();
            SelectedDotColour = DotColours.First();
        }