private NumberPieceXF?FindControl(NumberPieceCP thisPiece) { foreach (var thisCon in _thisGrid !.Children) { var Deck = (NumberPieceXF)thisCon !; if (Deck.BindingContext.Equals(thisPiece) == true) { return(Deck); } } return(null); }
private void PieceBindings(NumberPieceXF thisGraphics, NumberPieceCP thisPiece) { thisGraphics.HeightRequest = _graphicsSize !.GetWidthHeight; thisGraphics.WidthRequest = _graphicsSize.GetWidthHeight; thisGraphics.IsVisible = true; // i think needs to manually be set. var thisBind = GetCommandBinding(nameof(NumberPicker.NumberPickedCommand)); thisGraphics.SetBinding(GameGraphics.Base.GraphicsCommand.CommandProperty, thisBind); thisGraphics.CommandParameter = thisPiece; // must be piece, not simply the color. something else will figure out the color. thisGraphics.BindingContext = thisPiece; thisGraphics.SetBinding(NumberPieceXF.IsSelectedProperty, new Binding(nameof(BaseGraphicsCP.IsSelected))); // i think thisGraphics.SetBinding(IsEnabledProperty, new Binding(nameof(BaseGraphicsCP.IsEnabled))); thisGraphics.SetBinding(NumberPieceXF.NumberValueProperty, new Binding(nameof(NumberPieceCP.NumberValue))); thisGraphics.SendPiece(thisPiece); }
public void LoadNumberList(CustomBasicList <int> thisList) { if (thisList.Any(Items => Items < 0)) { throw new BasicBlankException("You should not be allowed to use less than 0. If that is needed, then rethinking is required"); } CustomBasicList <NumberPieceCP> tempList = new CustomBasicList <NumberPieceCP>(); thisList.ForEach(items => { NumberPieceCP ThisNumber = new NumberPieceCP(); ThisNumber.NumberValue = items; tempList.Add(ThisNumber); }); NumberList.ReplaceRange(tempList); }
private void PieceBindings(NumberPieceWPF thisGraphics, NumberPieceCP thisPiece) { thisGraphics.Height = _graphicsSize !.GetWidthHeight; thisGraphics.Width = _graphicsSize.GetWidthHeight; thisGraphics.Visibility = Visibility.Visible; // i think needs to manually be set. var thisBind = GetCommandBinding(nameof(NumberPicker.NumberPickedCommand)); //okay this is old fashioned this time. thisGraphics.SetBinding(GraphicsCommand.CommandProperty, thisBind); thisGraphics.CommandParameter = thisPiece; // must be piece, not simply the color. something else will figure out the color. thisGraphics.Margin = new Thickness(5, 5, 5, 5); thisGraphics.DataContext = thisPiece; thisGraphics.SetBinding(NumberPieceWPF.IsSelectedProperty, new Binding(nameof(BaseGraphicsCP.IsSelected))); // i think thisGraphics.SetBinding(IsEnabledProperty, new Binding(nameof(BaseGraphicsCP.IsEnabled))); thisGraphics.SetBinding(NumberPieceWPF.NumberValueProperty, new Binding(nameof(NumberPieceCP.NumberValue))); thisGraphics.SendPiece(thisPiece); }
private async Task ChooseNumberAsync(NumberPieceCP piece) { SelectNumberValue(piece.NumberValue); await ChangedNumberValueAsync !.Invoke(piece.NumberValue); }