public MainWindow(MainWindowVM mainWindowVM, IImagesFactory imagesFactory) { InitializeComponent(); DataContext = mainWindowVM; _board = new BoardControl(mainWindowVM.Board, imagesFactory); BoardGrid.Children.Add(_board); }
public BoardControl(BoardVM vm, IImagesFactory piecesImageFactory) { InitializeComponent(); Border.BorderBrush = new ImageBrush(new BitmapImage(BORDER_URI)); _piecesImageFactory = piecesImageFactory; _vm = vm; DataContext = vm; Init(); }
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); }
public VkApi(IImagesFactory imagesFactory, string accessToken) { _imagesFactory = imagesFactory; _accessToken = accessToken; }