public void SendDiceInfo(CategoriesDice thisDice, ThinkTwiceGameContainer gameContainer) //it did send dice { _gameContainer = gameContainer; IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _mains = new ButtonDiceGraphicsCP(); _mains.PaintUI = this; _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(TextProperty, new Binding(nameof(CategoriesDice.Value))); SetBinding(HoldProperty, new Binding(nameof(CategoriesDice.Hold))); SetBinding(IsVisibleProperty, new Binding(nameof(CategoriesDice.Visible))); SKSize tempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = tempSize.GetSizeUsed(thisP.Proportion * 1.3f); HeightRequest = DiceSize.Height; WidthRequest = DiceSize.Width; BindingContext = thisDice; Init(); }
public static string GetDiceTag => "StandardDice"; //same as other dice. //private ICommand? Command; public void SendDiceInfo(CategoriesDice thisDice, ThinkTwiceGameContainer gameContainer) //it did send dice { IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisP = thisR.Resolve <IProportionImage>(GetDiceTag); _gameContainer = gameContainer; _mains = new ButtonDiceGraphicsCP(); _mains.PaintUI = this; _mains.MinimumWidthHeight = thisDice.HeightWidth; SetBinding(TextProperty, nameof(CategoriesDice.Value)); SetBinding(HoldProperty, nameof(CategoriesDice.Hold)); SetBinding(VisibilityProperty, GetVisibleBinding(nameof(CategoriesDice.Visible))); SKSize TempSize = new SKSize(thisDice.HeightWidth, thisDice.HeightWidth); DiceSize = TempSize.GetSizeUsed(thisP.Proportion); //Command = thisDice.CategoryClickCommand!; Height = DiceSize.Height; Width = DiceSize.Width; DataContext = thisDice; Init(); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. ThinkTwiceSaveInfo save = cons !.Resolve <ThinkTwiceSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _diceControl !.LoadDiceViewModel(_model.Cup !); CategoriesDice thisCat = _resolver.Resolve <CategoriesDice>(); //i think Multiplier thisMul = _resolver.Resolve <Multiplier>(); CategoryXF first = new CategoryXF(); first.SendDiceInfo(thisCat, _gameContainer); first.Margin = new Thickness(0); //well see on tablets. _multStack !.Children.Add(first); MultXF second = new MultXF(); second.SendDiceInfo(thisMul); second.Margin = new Thickness(0); _multStack.Children.Add(second); return(this.RefreshBindingsAsync(_aggregator)); }