Skip to content

Commit 4a1e20d

Browse files
modified code
1 parent 15ae84a commit 4a1e20d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

DoughnutChartWithDrillDown/DoughnutChart/MainPage.xaml.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,17 @@ public class CenterViewDimension : IValueConverter
3838
{
3939
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
4040
{
41-
// int value1 = 0;
42-
// value1 = (int)value;
43-
//#if MACCATALYST
41+
double size = 0d;
4442

45-
// value1 = value1 / 4;
46-
//#endif
47-
// return value1;
43+
if(value == null)
44+
{
45+
return size;
46+
}
4847

49-
double size;
50-
string para = value.ToString();
48+
string? para = value.ToString();
5149

5250
#if MACCATALYST
53-
if(value != null && double.TryParse(para, out size))
51+
if(string.IsNullOrEmpty(para) && double.TryParse(para, out size))
5452
{
5553
return (double)value / 2;
5654
}

0 commit comments

Comments
 (0)