Skip to content

Commit b6bcea0

Browse files
Moved internal changes to public
1 parent f1dfe56 commit b6bcea0

File tree

125 files changed

+1248
-577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1248
-577
lines changed

maui/samples/Gallery/Samples/Button/Customizations/View/CustomizationsDesktop.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
<ColumnDefinition Width="Auto"/>
467467
<ColumnDefinition Width="*"/>
468468
</Grid.ColumnDefinitions>
469-
<Label Text="BackgroundImage Aspect "
469+
<Label Text="Background Image Aspect "
470470
FontFamily="Roboto-Regular"
471471
HorizontalTextAlignment="Start"
472472
Grid.Column="0"
@@ -476,6 +476,7 @@
476476
FontFamily="Roboto-Regular"
477477
FontSize="14"
478478
WidthRequest="120"
479+
IsEnabled="{Binding EnableAspectList}"
479480
ItemsSource="{Binding AspectList}"
480481
SelectedIndex="{Binding AspectSelectedIndex}"/>
481482
</Grid>

maui/samples/Gallery/Samples/Button/Customizations/View/CustomizationsMobile.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@
433433
<ColumnDefinition Width="Auto"/>
434434
<ColumnDefinition Width="*"/>
435435
</Grid.ColumnDefinitions>
436-
<Label Text="BackgroundImage Aspect"
436+
<Label Text="Background Image Aspect"
437437
FontFamily="Roboto-Medium"
438438
HorizontalTextAlignment="Start"
439439
Grid.Column="0"
@@ -442,6 +442,7 @@
442442
WidthRequest="120"
443443
HorizontalOptions="End"
444444
FontSize="15"
445+
IsEnabled="{Binding EnableAspectList}"
445446
ItemsSource="{Binding AspectList}"
446447
SelectedIndex="{Binding AspectSelectedIndex}"/>
447448
</Grid>

maui/samples/Gallery/Samples/Button/Customizations/ViewModel/ViewModel.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ public partial class ViewModel : INotifyPropertyChanged
104104
/// Selected Index of BackgroundImageAspect.
105105
/// </summary>
106106
private int _aspectSelectedIndex = 0;
107+
108+
/// <summary>
109+
/// Represents whether the AspectList feature is enabled.
110+
/// </summary>
111+
private bool _enableAspectList = false;
112+
107113
#endregion
108114

109115
#region Property
@@ -314,10 +320,12 @@ public bool CanShowBackgroundImage
314320
if (value)
315321
{
316322
BackgroundImage = "april.png";
323+
EnableAspectList = true;
317324
}
318325
else
319326
{
320327
BackgroundImage = null;
328+
EnableAspectList = false;
321329
}
322330
OnPropertyChanged("CanShowBackgroundImage");
323331
OnPropertyChanged("BackgroundImage");
@@ -414,6 +422,15 @@ public int TextTransformSelectedIndex
414422
}
415423
}
416424

425+
public bool EnableAspectList
426+
{
427+
get { return _enableAspectList; }
428+
set
429+
{
430+
_enableAspectList = value;
431+
OnPropertyChanged("EnableAspectList");
432+
}
433+
}
417434

418435
#endregion
419436

maui/samples/Gallery/Samples/Calendar/DateSelection/View/DateSelection.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<ColumnDefinition Width="0.5*"/>
5151
<ColumnDefinition Width="0.5*"/>
5252
</Grid.ColumnDefinitions>
53-
<Label Text="Selection Type"
53+
<Label Text="Selection type"
5454
Grid.Column="0"
5555
LineBreakMode="WordWrap"
5656
FontSize="14"

maui/samples/Gallery/Samples/Calendar/GettingStarted/View/GettingStarted.xaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<ColumnDefinition Width="0.5*"/>
3131
<ColumnDefinition Width="0.5*"/>
3232
</Grid.ColumnDefinitions>
33-
<Label Text="Calendar View"
33+
<Label Text="Calendar view"
3434
Grid.Column="0"
3535
LineBreakMode="WordWrap"
3636
FontSize="14"
@@ -51,7 +51,7 @@
5151
<ColumnDefinition Width="0.5*"/>
5252
<ColumnDefinition Width="0.5*"/>
5353
</Grid.ColumnDefinitions>
54-
<Label Text="Calendar Selection"
54+
<Label Text="Calendar selection"
5555
Grid.Column="0"
5656
LineBreakMode="WordWrap"
5757
FontSize="14"
@@ -93,7 +93,7 @@
9393
<ColumnDefinition Width="0.5*"/>
9494
<ColumnDefinition Width="0.5*"/>
9595
</Grid.ColumnDefinitions>
96-
<Label Text="Selection Direction"
96+
<Label Text="Selection direction"
9797
x:Name="selectionDirectionText"
9898
Grid.Column="0"
9999
LineBreakMode="WordWrap"
@@ -115,13 +115,16 @@
115115
<ColumnDefinition Width="0.5*"/>
116116
<ColumnDefinition Width="0.5*"/>
117117
</Grid.ColumnDefinitions>
118-
<Label Text="Display Date"
118+
<Label Text="Display date"
119119
LineBreakMode="WordWrap"
120120
FontSize="14"
121121
VerticalOptions="Center"
122-
HorizontalOptions="Start"/>
123-
<DatePicker x:Name="datePicker" HeightRequest="37"
124-
Grid.Column="1"/>
122+
HorizontalOptions="Start"
123+
HeightRequest="37"
124+
VerticalTextAlignment="Center"/>
125+
<DatePicker x:Name="datePicker"
126+
Grid.Column="1"
127+
VerticalOptions="Center" />
125128
</Grid>
126129

127130
<Grid x:Name="allowViewNavigationGrid">
@@ -187,7 +190,7 @@
187190
<ColumnDefinition Width="0.7*"/>
188191
<ColumnDefinition Width="0.3*"/>
189192
</Grid.ColumnDefinitions>
190-
<Label Text="Enable Past Dates"
193+
<Label Text="Enable past dates"
191194
LineBreakMode="WordWrap"
192195
FontSize="14"
193196
VerticalOptions="Center"
@@ -206,7 +209,7 @@
206209
<ColumnDefinition Width="0.7*"/>
207210
<ColumnDefinition Width="0.3*"/>
208211
</Grid.ColumnDefinitions>
209-
<Label Text="Enable swipe Selection"
212+
<Label Text="Enable swipe selection"
210213
LineBreakMode="WordWrap"
211214
FontSize="14"
212215
VerticalOptions="Center"

maui/samples/Gallery/Samples/Cards/GettingStarted/Behavior/GettingStartedBehavior.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void CornerRadiusSlider_ValueChanged(object? sender, ValueChangedEventArgs e)
161161
_thirdCard.CornerRadius = new CornerRadius(Math.Round(e.NewValue));
162162
_fourthCard.CornerRadius = new CornerRadius(Math.Round(e.NewValue));
163163
_fifthCard.CornerRadius = new CornerRadius(Math.Round(e.NewValue));
164-
_cornerRadiusLabel.Text = "CornerRadius: " + Math.Round(e.NewValue);
164+
_cornerRadiusLabel.Text = "Corner radius: " + Math.Round(e.NewValue);
165165
}
166166
}
167167

maui/samples/Gallery/Samples/Chips/ChipGettingStarted/ChipGettingStaredMobile.xaml.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ public ChipGettingStartedMobile()
1010
}
1111
private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit.Chips.SelectionChangedEventArgs e)
1212
{
13-
if (sender != null && ((sender as SfChipGroup)?.BindingContext as ChipViewModel) != null)
13+
if (sender != null && sender is SfChipGroup chipGroup && chipGroup.BindingContext is ChipViewModel viewModel)
1414
{
15-
#pragma warning disable CS8602 // Dereference of a possibly null reference.
1615
if (!string.IsNullOrEmpty("SelectedAddOnItems"))
1716
{
18-
var viewModel = ((sender as SfChipGroup).BindingContext as ChipViewModel);
1917
if (viewModel.SelectedAddOnItems.Contains("Fast Charge"))
2018
{
2119
viewModel.FastChargePrice = 399;
@@ -26,7 +24,7 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
2624
}
2725
if (viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
2826
{
29-
viewModel.WarrentyPrice = 799;
27+
viewModel.WarrantyPrice = 799;
3028
}
3129
if (!viewModel.SelectedAddOnItems.Contains("Fast Charge"))
3230
{
@@ -38,11 +36,11 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
3836
}
3937
if (!viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
4038
{
41-
viewModel.WarrentyPrice = 0;
39+
viewModel.WarrantyPrice = 0;
4240
}
4341
if (viewModel.SelectedAddOnItems.Contains("Fast Charge") || viewModel.SelectedAddOnItems.Contains("512 MB SD Card") || viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
4442
{
45-
viewModel.TotalAmount = viewModel.FastChargePrice + viewModel.SDCardPrice + viewModel.WarrentyPrice;
43+
viewModel.TotalAmount = viewModel.FastChargePrice + viewModel.SDCardPrice + viewModel.WarrantyPrice;
4644
viewModel.TotalPrice = "$ " + viewModel.TotalAmount;
4745
}
4846
else
@@ -51,8 +49,10 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
5149
viewModel.TotalPrice = "$ " + viewModel.TotalAmount;
5250
}
5351
}
54-
} ((sender as SfChipGroup).BindingContext as ChipViewModel).FinalAmount = ((sender as SfChipGroup).BindingContext as ChipViewModel).TotalAmount;
55-
#pragma warning restore CS8602 // Dereference of a possibly null reference.
52+
53+
viewModel.FinalAmount = viewModel.TotalAmount;
54+
}
55+
5656
}
5757
}
5858
}

maui/samples/Gallery/Samples/Chips/ChipGettingStarted/ChipGettingStartedDesktop.xaml.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ public ChipGettingStartedDesktop()
1111
}
1212
private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit.Chips.SelectionChangedEventArgs e)
1313
{
14-
if (sender != null && ((sender as SfChipGroup)?.BindingContext as ChipViewModel) != null)
14+
if (sender != null && sender is SfChipGroup chipGroup && chipGroup.BindingContext is ChipViewModel viewModel)
1515
{
16-
#pragma warning disable CS8602 // Dereference of a possibly null reference.
1716
if (!string.IsNullOrEmpty("SelectedAddOnItems"))
1817
{
19-
var viewModel = ((sender as SfChipGroup).BindingContext as ChipViewModel);
2018
if (viewModel.SelectedAddOnItems.Contains("Fast Charge"))
2119
{
2220
viewModel.FastChargePrice = 657;
@@ -27,7 +25,7 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
2725
}
2826
if (viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
2927
{
30-
viewModel.WarrentyPrice = 799;
28+
viewModel.WarrantyPrice = 799;
3129
}
3230
if (!viewModel.SelectedAddOnItems.Contains("Fast Charge"))
3331
{
@@ -39,11 +37,11 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
3937
}
4038
if (!viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
4139
{
42-
viewModel.WarrentyPrice = 0;
40+
viewModel.WarrantyPrice = 0;
4341
}
4442
if (viewModel.SelectedAddOnItems.Contains("Fast Charge") || viewModel.SelectedAddOnItems.Contains("512 MB SD Card") || viewModel.SelectedAddOnItems.Contains("2 Years Extended Warranty"))
4543
{
46-
viewModel.TotalAmount = viewModel.FastChargePrice + viewModel.SDCardPrice + viewModel.WarrentyPrice;
44+
viewModel.TotalAmount = viewModel.FastChargePrice + viewModel.SDCardPrice + viewModel.WarrantyPrice;
4745
viewModel.TotalPrice = "$ " + viewModel.TotalAmount;
4846
}
4947
else
@@ -53,8 +51,9 @@ private void SfChipGroup_SelectionChanged(object sender, Syncfusion.Maui.Toolkit
5351
}
5452

5553
}
56-
} ((sender as SfChipGroup).BindingContext as ChipViewModel).FinalAmount = ((sender as SfChipGroup).BindingContext as ChipViewModel).TotalAmount;
57-
#pragma warning restore CS8602 // Dereference of a possibly null reference.
54+
55+
viewModel.FinalAmount = viewModel.TotalAmount;
56+
}
5857
}
5958
}
6059
}

maui/samples/Gallery/Samples/Chips/ViewModel/ChipViewModel.cs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void OnPropertyChanged([CallerMemberName] string? name = null) =>
192192
List<string>? _addOnItems = ["Fast Charge", "512 MB SD Card", "2 Years Extended Warranty"];
193193

194194
/// <summary>
195-
/// The devivery option choice collection.
195+
/// The delivery option choice collection.
196196
/// </summary>
197197
List<string>? _deliveryOptions = ["Free Delivery", "+$5 for 1 Day Delivery"];
198198

@@ -236,9 +236,9 @@ public void OnPropertyChanged([CallerMemberName] string? name = null) =>
236236
int _sdCardPrice = 0;
237237

238238
/// <summary>
239-
/// The warrenty price.
239+
/// The warranty price.
240240
/// </summary>
241-
int _warrentyPrice = 0;
241+
int _warrantyPrice = 0;
242242

243243
/// <summary>
244244
/// The delivery date.
@@ -922,7 +922,7 @@ public List<string>? DeliveryOptions
922922
}
923923

924924
/// <summary>
925-
/// Gets or sets the contols list.
925+
/// Gets or sets the controls list.
926926
/// </summary>
927927
/// <value>The ControlsList.</value>
928928
public List<string>? ControlsList
@@ -1020,13 +1020,13 @@ public int SDCardPrice
10201020
}
10211021

10221022
/// <summary>
1023-
/// Gets or sets the warrenty price.
1023+
/// Gets or sets the warranty price.
10241024
/// </summary>
1025-
/// <value>The WarrentyPrice.</value>
1026-
public int WarrentyPrice
1025+
/// <value>The WarrantyPrice.</value>
1026+
public int WarrantyPrice
10271027
{
1028-
get { return _warrentyPrice; }
1029-
set { _warrentyPrice = value; OnPropertyChanged(nameof(WarrentyPrice)); }
1028+
get { return _warrantyPrice; }
1029+
set { _warrantyPrice = value; OnPropertyChanged(nameof(WarrantyPrice)); }
10301030
}
10311031

10321032
/// <summary>
@@ -1183,7 +1183,6 @@ public SfChipsType ChipType
11831183
/// <summary>
11841184
/// Initializes a new instance of the <see cref="T:Chip.ChipViewModel"/> class.
11851185
/// </summary>
1186-
[Obsolete]
11871186
public ChipViewModel()
11881187
{
11891188
ActionCommand = new Command(HandleAction);
@@ -1196,20 +1195,16 @@ public ChipViewModel()
11961195
void HandleAction(object obj)
11971196
{
11981197
Result.Clear();
1199-
1200-
#pragma warning disable CS8602 // Dereference of a possibly null reference.
1201-
if (obj != null && obj.ToString().Equals("Search by brands", StringComparison.Ordinal) && _selectedItem != null && _brands.Count > 0)
1198+
if (obj?.ToString()?.Equals("Search by brands", StringComparison.Ordinal) == true && _selectedItem != null && _brands?.Count > 0)
12021199
{
12031200
foreach (var brand in _brands)
12041201
{
12051202
Result.Add(new Random().Next(1, 5).ToString() + " " + brand.ToString() + " " + _selectedItem.ToString() + " found");
12061203
}
12071204
}
12081205

1209-
else if (FilterItems.Count > 0 && _selectedItem != null && _selectedFilterItems.Count > 0 && _brands.Count > 0)
1206+
else if (FilterItems.Count > 0 && _selectedItem != null && _selectedFilterItems.Count > 0 && _brands?.Count > 0)
12101207
{
1211-
1212-
12131208
foreach (var feature in _selectedFilterItems)
12141209
{
12151210
foreach (var brand in _brands)

maui/samples/Gallery/Samples/NavigationDrawer/GettingStarted/View/GettingStartedDesktop.xaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<Label Grid.Row="1" Text="Leslie Alexander" Margin="0,5,0,0" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontAttributes="Bold" FontSize="20" WidthRequest="154" HeightRequest="24" HorizontalOptions="Center"/>
3232
<Label Grid.Row="2" Text="UX Designer" Margin="0,5,0,0" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontSize="14" WidthRequest="148" HeightRequest="24" HorizontalOptions="Center"/>
3333
</Grid>
34-
<BoxView WidthRequest="304" HeightRequest="1" BackgroundColor="{AppThemeBinding Light={StaticResource FilledInputBorderLight1}, Dark={StaticResource FilledInputBorderDark}}"/>
34+
<BoxView HeightRequest="1" Margin="20,0" BackgroundColor="{AppThemeBinding Light={StaticResource FilledInputBorderLight1}, Dark={StaticResource FilledInputBorderDark}}"/>
3535
</VerticalStackLayout>
3636
</navigationdrawer:DrawerSettings.DrawerHeaderView>
3737
<navigationdrawer:DrawerSettings.DrawerContentView>
@@ -308,13 +308,9 @@
308308

309309
<localcore:SampleView.OptionView>
310310
<VerticalStackLayout Spacing="20" Margin="10">
311-
<Grid ColumnDefinitions="*,*">
311+
<Grid ColumnDefinitions="*,*" Margin="0,-18,0,0">
312312
<Label Text="Position" VerticalOptions="Center"/>
313-
<Border Grid.Column="1" BackgroundColor="Transparent" Stroke="{AppThemeBinding Light={StaticResource BorderLight}, Dark={StaticResource BorderDark}}" Margin="0" Padding="0">
314-
<Border.StrokeShape>
315-
<RoundRectangle CornerRadius="5" />
316-
</Border.StrokeShape>
317-
<Picker HeightRequest="37" x:Name="positioncomboBox"
313+
<Picker Grid.Column="1" HeightRequest="37" x:Name="positioncomboBox"
318314
BackgroundColor="{AppThemeBinding Light={StaticResource BackgroundLight}, Dark={StaticResource BackgroundDark}}"
319315
TextColor="{AppThemeBinding Light={StaticResource TextColourLight}, Dark={StaticResource TextColourDark}}">
320316
<Picker.ItemsSource>
@@ -329,7 +325,6 @@
329325
<x:String>Left</x:String>
330326
</Picker.SelectedItem>
331327
</Picker>
332-
</Border>
333328
</Grid>
334329
</VerticalStackLayout>
335330
</localcore:SampleView.OptionView>

0 commit comments

Comments
 (0)