Exemple #1
0
        public MainWindow(MainWindowVM mainWindowVM,
                          IImagesFactory imagesFactory)
        {
            InitializeComponent();
            DataContext = mainWindowVM;

            _board = new BoardControl(mainWindowVM.Board, imagesFactory);
            BoardGrid.Children.Add(_board);
        }
Exemple #2
0
        public BoardControl(BoardVM vm,
                            IImagesFactory piecesImageFactory)
        {
            InitializeComponent();

            Border.BorderBrush  = new ImageBrush(new BitmapImage(BORDER_URI));
            _piecesImageFactory = piecesImageFactory;

            _vm         = vm;
            DataContext = vm;
            Init();
        }
Exemple #3
0
        public BoardCellControl(SquareVM vm,
                                IImagesFactory imagesFactory)
        {
            _vm           = vm;
            _board        = vm.Board;
            DataContext   = vm;
            _imageFactory = imagesFactory;

            Position    = vm.Position;
            Background  = GetColorFromVM(vm.Color);
            BorderBrush = System.Windows.Media.Brushes.Black;
            SetGridCoordinate();

            InitializeComponent();

            vm.WhenAny(x => x.Piece, x => x.Value)
            .Subscribe(SetImage);
        }
Exemple #4
0
 public VkApi(IImagesFactory imagesFactory, string accessToken)
 {
     _imagesFactory = imagesFactory;
     _accessToken   = accessToken;
 }