public object Convert(object value, Type targetType, object parameter, String a) { if (parameter == null) { return(10); } String ParameterValue = (String)parameter; int intParameter = int.Parse(ParameterValue); double Converted = ((double)intParameter / 1.2) * Tennis_Statistics.Helpers.ResolutionHelper.CurrentPixelsPerViewPixel; Converted = Math.Round(Converted); if (targetType == typeof(Double)) { return(Converted); } if (targetType == typeof(Windows.UI.Xaml.GridLength)) { Windows.UI.Xaml.GridLength Result = new Windows.UI.Xaml.GridLength(Converted); return(Result); } return(null); }
internal double[] CalculateWidths(double width, int ncols) { if (ncols <= 0) { throw new ArgumentException("ncols"); } Windows.UI.Xaml.GridLength[] glens = new Windows.UI.Xaml.GridLength[ncols]; for (int i = 0; i < ncols; i++) { if (i < ColumnDefinitions.Count) { glens[i] = ColumnDefinitions[i].Width; } else { glens[i] = Windows.UI.Xaml.GridLength.Auto; } } return(CalculateLengths(width, ncols, glens)); }
internal double[] CalculateHeights(double height, int nrows) { if (nrows <= 0) { throw new ArgumentException("nrows"); } Windows.UI.Xaml.GridLength[] glens = new Windows.UI.Xaml.GridLength[nrows]; for (int i = 0; i < nrows; i++) { if (i < RowDefinitions.Count) { glens[i] = RowDefinitions[i].Height; } else { glens[i] = Windows.UI.Xaml.GridLength.Auto; } } return(CalculateLengths(height, nrows, glens)); }
public bool Equals(Windows.UI.Xaml.GridLength gridLength) { throw null; }