public void LoadLists(IListViewPicker mod) { _thisMod = mod; _textList = _thisMod.TextList; _textList.CollectionChanged += TextList_CollectionChanged; if (TotalColumns == 0) { _thisStack = new StackLayout(); _thisStack.Orientation = Orientation; } else { _thisGrid = new Grid(); AddAutoRows(_thisGrid, 1); //at least one row obviously. AddAutoColumns(_thisGrid, TotalColumns); } Margin = new Thickness(3, 3, 3, 3); PopulateList(); if (TotalColumns == 0) { Content = _thisStack; } else { Content = _thisGrid; } }
public void LoadLists(NumberPicker mod) { _thisMod = mod; _numberList = mod.NumberList; Margin = new Thickness(5, 5, 5, 5); _numberList.CollectionChanged += NumberList_CollectionChanged; _thisGrid = new Grid(); _thisGrid.HorizontalOptions = LayoutOptions.Start; _thisGrid.VerticalOptions = LayoutOptions.Start; HorizontalOptions = LayoutOptions.Start; VerticalOptions = LayoutOptions.Start; _thisGrid.RowSpacing = 0; _thisGrid.ColumnSpacing = 0; _graphicsSize = Resolve <IWidthHeight>(); //you do have to register that one now. _thisGrid = new Grid(); AddAutoColumns(_thisGrid, 15); if (TotalRows > 0) { HeightRequest = _graphicsSize.GetWidthHeight * TotalRows; TotalRows.Times(x => AddPixelRow(_thisGrid, _graphicsSize.GetWidthHeight)); _thisGrid.ColumnSpacing = 5; } else { AddAutoRows(_thisGrid, 15); } PopulateList(); Content = _thisGrid; }
public void Init(PublicViewModel mod) { Background = Brushes.Transparent; _thisMod = mod; _thisStack = new WrapPanel(); var tempCard = new DutchBlitzCardInformation(); var thisP = Resolve <IProportionImage>(); _thisStack.ItemHeight = tempCard.DefaultSize.Height * thisP.Proportion; _thisStack.ItemWidth = tempCard.DefaultSize.Width * thisP.Proportion; _thisStack.Orientation = Orientation.Horizontal; // start out horizontally MouseUp += PublicPilesWPF_MouseUp; _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileWPF thisCon = new IndividualPileWPF(); thisCon.IsHitTestVisible = true; thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } Content = _thisStack; }
public void Init(MainSetsObservable <SU, CO, RU, SE, T> thisMod, string tagUsed) { _tagUsed = tagUsed; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T> thisTemp; Grid firstGrid = new Grid(); ScrollView thisScroll = new ScrollView(); thisScroll.Orientation = ScrollOrientation.Both; if (thisMod.HasFrame == true) { Text = thisMod.Text; var thisRect = ThisFrame.GetControlArea(); thisScroll.Margin = new Thickness((double)thisRect.Left + (float)3, (double)thisRect.Top + (float)3, 3, 5); // try this way. firstGrid.Children.Add(ThisDraw); firstGrid.Children.Add(thisScroll); } else { firstGrid.Children.Add(thisScroll);// this alone. } _setList = thisMod.SetList; foreach (var thisSet in thisMod.SetList) { thisTemp = new IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T>(); thisTemp.Divider = Divider; thisTemp.Additionals = Additionals; thisTemp.LoadList(thisSet, tagUsed); _thisStack.Children.Add(thisTemp); } _setList.CollectionChanged += SetList_CollectionChanged; thisScroll.Content = _thisStack; Content = firstGrid; }
public void LoadLists(IListViewPicker mod) { _thisMod = mod; _textList = _thisMod.TextList; _textList.CollectionChanged += TextList_CollectionChanged; Visibility = Visibility.Visible; //could be iffy (?) //hopefully no need for the other part. //_thisMod.PropertyChanged += ThisMod_PropertyChanged; if (TotalColumns == 0) { _thisStack = new StackPanel(); _thisStack.Orientation = Orientation; } else { _thisGrid = new Grid(); AddAutoRows(_thisGrid, 1); //at least one row obviously. AddAutoColumns(_thisGrid, TotalColumns); } Margin = new Thickness(3, 3, 3, 3); PopulateList(); if (TotalColumns == 0) { Content = _thisStack; } else { Content = _thisGrid; } }
public void Update(A8RoundRummyMainGameClass mainGame) { _roundList = mainGame.SaveRoot !.RoundList; _roundList.CollectionChanged -= RoundList_CollectionChanged; _roundList.CollectionChanged += RoundList_CollectionChanged; PopulateList(); }
public void Init(TeamCP mod, MillebournesMainGameClass mainGame, CommandContainer commandContainer) { _safetyMod = mod; _commandContainer = commandContainer; _safetyList = _safetyMod.SafetyList; _safetyList.CollectionChanged += SafetyList_CollectionChanged; StackLayout thisStack = new StackLayout(); thisStack.Margin = new Thickness(3, 0, 3, 0); _safetyStack = new StackLayout(); _safetyStack.Spacing = 0; StackLayout tempStack = new StackLayout(); tempStack.Orientation = StackOrientation.Horizontal; var thisBut = GetButton("Safety", nameof(TeamCP.SafetyClickAsync), nameof(TeamCP.SafetyEnabled), mainGame); tempStack.Children.Add(thisBut); thisStack.Children.Add(_safetyStack); thisStack.Children.Add(tempStack); _safetyMod.SafetyList.ForEach(thisSafe => { AddLabel(thisSafe); }); Content = thisStack; }
public void Init(PublicViewModel mod) { _thisMod = mod; _thisStack = new StackLayout(); var tempCard = new DutchBlitzCardInformation(); var thisP = Resolve <IProportionImage>(); HeightRequest = tempCard.DefaultSize.Height * thisP.Proportion; _thisStack.Orientation = StackOrientation.Horizontal; // start out horizontally _thisStack.HorizontalOptions = LayoutOptions.Start; _thisStack.VerticalOptions = LayoutOptions.Start; Grid grid = new Grid(); _drawControl = new SKCanvasView(); _drawControl.EnableTouchEvents = true; _drawControl.Touch += TouchEvent; _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileXF thisCon = new IndividualPileXF(); thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } grid.Children.Add(_drawControl); grid.Children.Add(_thisStack); Content = grid; }
public void Init(A8RoundRummyGameContainer gameContainer) { _roundList = gameContainer.SaveRoot !.RoundList; _roundList.CollectionChanged += RoundList_CollectionChanged; _thisStack = new StackLayout(); PopulateList(); Content = _thisStack; }
public void UpdateList(RummyDiceHandVM thisMod) { BindingContext = null; BindingContext = thisMod; _thisMod = thisMod; _handList !.CollectionChanged -= HandList_CollectionChanged; _handList = thisMod.HandList; //rehook up again. PopulateControls(); }
public void LoadLists(CribbageVMData model) { _model = model; _thisGrid = new Grid(); _scoreList = _model.ScoreBoard1 !.ScoreList; _scoreList.CollectionChanged += ScoreList_CollectionChanged; AddAutoColumns(_thisGrid, 2); PopulateList(); Content = _thisGrid; }
public void Init(ThreeLetterFunVMData model) { _tempMod = model.TileBoard1; _tileList = _tempMod !.HandList; _tileList.CollectionChanged += TileList_CollectionChanged; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; Content = _thisStack; PopulateControls(); }
public void UpdateDiceViewModel(RummyDiceMainGameClass mainGame) { _thisMod = mainGame.MainBoard1; DataContext = _thisMod; _diceList !.CollectionChanged -= DiceList_CollectionChanged; _diceList = mainGame.SaveRoot !.DiceList; _diceList.CollectionChanged += DiceList_CollectionChanged; _thisStack !.Children.Clear(); PopulateList(); }
public void Init(TriangleObservable thisMod) { _thisMod = thisMod; _cardList = thisMod.CardList; _cardList.CollectionChanged += CollectionChange; _thisCanvas = new Canvas(); _thisMod.PositionUI = this; PopulateCards(); Content = _thisCanvas; }
public void Init(ThreeLetterFunVMData model) { //ThreeLetterFunViewModel thisMod = Resolve<ThreeLetterFunViewModel>(); _tempMod = model.TileBoard1; _tileList = _tempMod !.HandList; _tileList.CollectionChanged += TileList_CollectionChanged; _thisStack = new StackPanel(); _thisStack.Orientation = Orientation.Horizontal; Content = _thisStack; PopulateControls(); }
public void LoadDiceViewModel(RummyDiceMainGameClass mainGame) { _thisMod = mainGame.MainBoard1; _board = mainGame.MainBoard1; Margin = new Thickness(3, 3, 3, 3); BindingContext = _thisMod; _diceList = mainGame.SaveRoot !.DiceList; _diceList.CollectionChanged += DiceList_CollectionChanged; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; // will always be horizontal for this one. PopulateList(); Content = _thisStack; }
private CustomBasicCollection <G> ColorsLeft() { var firstList = PrivateGetList(); //start with entire list CustomBasicCollection <G> output = new CustomBasicCollection <G>(); firstList.ForEach(items => { if (AlreadyTaken(items.EnumValue) == false) { output.Add(items); } }); return(output); }
public void Init(TriangleObservable thisMod) { SolitaireCard card = new SolitaireCard(); GamePackageDIContainer tt = Resolve <GamePackageDIContainer>(); IProportionImage pp = tt.Resolve <IProportionImage>(ts.TagUsed); _size = card.DefaultSize.GetSizeUsed(pp.Proportion); _thisMod = thisMod; _cardList = thisMod.CardList; _cardList.CollectionChanged += CollectionChange; _thisCanvas = new AbsoluteLayout(); _thisMod.PositionUI = this; PopulateCards(); Content = _thisCanvas; }
public void Update(MainSetsObservable <SU, CO, RU, SE, T> thisMod) { _thisStack !.Children.Clear(); _setList !.CollectionChanged -= SetList_CollectionChanged; _setList = thisMod.SetList; _setList.CollectionChanged += SetList_CollectionChanged; foreach (var thisSet in thisMod.SetList) { var thisTemp = new IndividualRummySetWPF <SU, CO, RU, GC, GW, SE, T>(); thisTemp.Divider = Divider; thisTemp.Additionals = Additionals; thisTemp.LoadList(thisSet, _tagUsed); _thisStack.Children.Add(thisTemp); } }
public void Init(XactikaVMData thisMod) { _tempMod = thisMod.ShapeChoose1; _shapeList = _tempMod !.PieceList; Margin = new Thickness(10, 10, 10, 10); DataContext = _tempMod; // i think var thisBind = GetVisibleBinding(nameof(ChooseShapeObservable.Visible)); SetBinding(VisibilityProperty, thisBind); // i think _thisStack = new StackPanel(); _thisStack.Orientation = Orientation.Horizontal; // for this time, must be horizontal. _shapeList.CollectionChanged += ShapeList_CollectionChanged; Content = _thisStack; PopulateList(); }
public void LoadLists(NumberPicker mod) { _thisMod = mod; _numberList = mod.NumberList; Margin = new Thickness(10, 10, 10, 10); _numberList.CollectionChanged += NumberList_CollectionChanged; //_thisMod.PropertyChanged += ThisMod_PropertyChanged; _thisGrid = new Grid(); _graphicsSize = Resolve <IWidthHeight>(); //you do have to register that one now. _thisGrid = new Grid(); AddAutoColumns(_thisGrid, 15); AddAutoRows(_thisGrid, 15); PopulateList(); Content = _thisGrid; }
public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame) { _thisMod = thisMod; _mainGame = mainGame; DataContext = thisMod; _handList = thisMod.HandList; _handList.CollectionChanged += HandList_CollectionChanged; Text = $"Temp Set {thisMod.Index}"; SetBinding(IsEnabledProperty, nameof(RummyDiceHandVM.IsEnabled)); RummyDiceInfo firstDice = new RummyDiceInfo(); if (firstDice.HeightWidth == 0) { throw new BasicBlankException("You must specify the height/width of the dice"); } IProportionImage thisI = new CustomProportionWPF(); SKSize firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth); var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion); Grid firstGrid = new Grid(); GridHelper.AddPixelRow(firstGrid, (int)sizeUsed.Height + 50); GridHelper.AddLeftOverRow(firstGrid, 1); Margin = new Thickness(3, 3, 3, 3); _thisStack = new StackPanel(); _thisStack.Orientation = Orientation.Horizontal; Button thisBut = GetGamingButton("Place Tiles", nameof(RummyDiceHandVM.BoardCommand)); //i think since its a different view model, has to do manually. thisBut.Name = ""; thisBut.Command = thisMod.BoardCommand; thisBut.Margin = new Thickness(5, 5, 5, 5); GridHelper.AddControlToGrid(firstGrid, _thisStack, 0, 0); GridHelper.AddControlToGrid(firstGrid, thisBut, 1, 0); _thisGrid = new Grid(); //hopefully does not need visible. if we need visible, rethink. //SetBinding(VisibilityProperty, GetVisibleBinding(nameof(RummyDiceHandVM.Visible))); _thisGrid.Children.Add(ThisDraw); _thisGrid.Children.Add(firstGrid); var thisRect = ThisFrame.GetControlArea(); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); Width = 1520; //different on xamarin forms. Height = 250; PopulateControls(); //just in case there is something to start with. Content = _thisGrid; }
public void UpdateLists(PublicPilesViewModel mod) { _thisMod = mod; _thisStack !.Children.Clear(); //best to just redo this time. _pileList !.CollectionChanged -= PileList_CollectionChanged; _pileList = _thisMod.PileList; _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileXF thisCon = new IndividualPileXF(); thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } }
public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame) { _thisMod = thisMod; _mainGame = mainGame; BindingContext = thisMod; HorizontalOptions = LayoutOptions.FillAndExpand; //hopefully this works too. _handList = thisMod.HandList; _handList.CollectionChanged += HandList_CollectionChanged; Text = $"Temp Set {thisMod.Index}"; SetBinding(IsEnabledProperty, new Binding(nameof(RummyDiceHandVM.IsEnabled))); RummyDiceInfo firstDice = new RummyDiceInfo(); if (firstDice.HeightWidth == 0) { throw new BasicBlankException("You must specify the height/width of the dice"); } IProportionImage thisI = new CustomProportionXF(); SKSize firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth); var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion); Margin = new Thickness(3, 3, 3, 3); _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Spacing = 0; Button thisBut = GetSmallerButton("Place Tiles", ""); thisBut.Command = thisMod.BoardCommand; //i think this way this time. StackLayout finalStack = new StackLayout(); finalStack.Orientation = StackOrientation.Horizontal; finalStack.Children.Add(thisBut); finalStack.Spacing = 2; finalStack.Children.Add(_thisStack); thisBut.HorizontalOptions = LayoutOptions.Start; thisBut.VerticalOptions = LayoutOptions.Start; _thisStack.HorizontalOptions = LayoutOptions.FillAndExpand; thisBut.FontSize *= .7f; _thisGrid = new Grid(); _thisGrid.Children.Add(ThisDraw); _thisGrid.Children.Add(finalStack); var thisRect = ThisFrame.GetControlArea(); thisBut.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); PopulateControls(); //just in case there is something to start with. Content = _thisGrid; }
public void Init(CribbagePatienceMainViewModel thisMod) { _thisMod = thisMod; Text = "Score Summary"; _scoreList = thisMod.Scores !.ScoreList; _scoreList.CollectionChanged += CollectionChanged; Grid parentGrid = new Grid(); _thisGrid = new Grid(); AddPixelColumn(_thisGrid, 150); AddAutoColumns(_thisGrid, 1); SetUpMarginsOnParentControl(_thisGrid); parentGrid.Children.Add(ThisDraw); parentGrid.Children.Add(_thisGrid); HorizontalOptions = LayoutOptions.Fill; //i think PopulateList(); Content = parentGrid; }
private void LoadBoard() { CardList = new CustomBasicCollection <SolitaireCard>(); SolitaireCard tempCard = new SolitaireCard(); SKSize tempSize = tempCard.DefaultSize.GetSizeUsed(_thisP.Proportion); _cardWidth = tempSize.Width; _cardHeight = tempSize.Height; _totalWidth = _maxRowsColumns * _cardWidth; int nums = HowManyCards; nums.Times(x => { tempCard = new SolitaireCard(); tempCard.IsEnabled = false; CardList.Add(tempCard); }); PositionCards(); }
public void Init(XactikaVMData thisMod, IGamePackageResolver resolver) { SKSize firstSize = new SKSize(60, 138); IProportionImage thisP = resolver.Resolve <IProportionImage>(""); _sizeUsed = firstSize.GetSizeUsed(thisP.Proportion); _tempMod = thisMod.ShapeChoose1; _shapeList = _tempMod !.PieceList; Margin = new Thickness(10, 10, 10, 10); BindingContext = _tempMod; // i think var thisBind = new Binding(nameof(ChooseShapeObservable.Visible)); SetBinding(IsVisibleProperty, thisBind); // i think _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; // for this time, must be horizontal. _shapeList.CollectionChanged += ShapeList_CollectionChanged; Content = _thisStack; PopulateList(); }
public void Init(CribbagePatienceMainViewModel thisMod) { _thisMod = thisMod; Text = "Score Summary"; _scoreList = thisMod.Scores !.ScoreList; _scoreList.CollectionChanged += CollectionChanged; Grid parentGrid = new Grid(); _thisGrid = new Grid(); AddPixelColumn(_thisGrid, 150); AddAutoColumns(_thisGrid, 1); var thisRect = ThisFrame.GetControlArea(); SetUpMarginsOnParentControl(_thisGrid, thisRect); parentGrid.Children.Add(ThisDraw); parentGrid.Children.Add(_thisGrid); HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; PopulateList(); Content = parentGrid; }
public async Task InitAsync(MonasteryCardGameVMData model, IUIView view, IEventAggregator aggregator) { _view = view; _aggregator = aggregator; Text = "Mission List"; _thisList = model.CompleteMissions; Grid mainGrid = new Grid(); var thisRect = ThisFrame.GetControlArea(); _thisGrid = new Grid(); _thisGrid.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); AddAutoRows(_thisGrid, 6); AddLeftOverColumn(_thisGrid, 50); AddLeftOverColumn(_thisGrid, 50); mainGrid.Children.Add(ThisDraw); mainGrid.Children.Add(_thisGrid); await PopulateListAsync(); _thisList.CollectionChanged += ListChange; Content = mainGrid; }
public void LoadLists(SimpleEnumPickerVM <E, GC> mod) { _thisMod = mod; _itemList = mod.ItemList; Margin = new Thickness(10, 10, 10, 10); _itemList.CollectionChanged += ItemList_CollectionChanged; //_thisMod.PropertyChanged += ThisMod_PropertyChanged; //if (_thisMod.Visible == true) // Visibility = Visibility.Visible; //try this way too. because on games like board games, it can be visible at this point. _thisGrid = new Grid(); if (Columns > 1 || Rows > 1) { GraphicsHeight = 100; GraphicsWidth = 100; } _thisGrid = new Grid(); AddAutoColumns(_thisGrid, 15); AddAutoRows(_thisGrid, 15); PopulateList(); Content = _thisGrid; }