Skip to content

Commit 7f4d13f

Browse files
committed
Fix: Resolve multiple issues
- Ensure compatibility with unsupported page loaded - Correct handling of null picker selected item and control information in collection view - Resolve build error in release mode - Prevent MediaElement crash upon page unload
1 parent 03ead8a commit 7f4d13f

File tree

35 files changed

+55
-227
lines changed

35 files changed

+55
-227
lines changed

maui-island.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Global
5252
{72B83E80-9D22-4A44-AB91-253A616A9D9C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
5353
{72B83E80-9D22-4A44-AB91-253A616A9D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
5454
{72B83E80-9D22-4A44-AB91-253A616A9D9C}.Release|Any CPU.Build.0 = Release|Any CPU
55+
{72B83E80-9D22-4A44-AB91-253A616A9D9C}.Release|Any CPU.Deploy.0 = Release|Any CPU
5556
{A9F55C31-8BED-4021-8F1B-1F5C7D4B2265}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5657
{A9F55C31-8BED-4021-8F1B-1F5C7D4B2265}.Debug|Any CPU.Build.0 = Debug|Any CPU
5758
{A9F55C31-8BED-4021-8F1B-1F5C7D4B2265}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/Core/MAUIsland.Core/Converters/StringTernaryOperatorConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class StringTernaryOperatorConverter : IValueConverter
44
{
55
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
66
{
7-
if (value is bool boolValue &&
7+
if (value is bool boolValue &&
88
parameter is string[] messages)
99
{
1010
return boolValue ? messages[0] : messages[1];

src/Core/MAUIsland.Core/Features/Gallery/Pages/BuiltIn/Controls/Checkbox/CheckBoxPageViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override async Task OnAppearingAsync()
4444
bool isChecked;
4545

4646
[ObservableProperty]
47-
string currentColor = "F2F1F1";
47+
Color currentColor = new Color(242, 241, 241, 255);
4848

4949
[ObservableProperty]
5050
string standardCheckBoxXamlCode = "<CheckBox />";

src/Core/MAUIsland.Core/Features/Gallery/Pages/BuiltIn/Controls/CollectionView/CollectionViewPageViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,9 @@ private async Task LoadDataAsync()
10581058
FilterPickerItems.Add("None");
10591059
SelectedFilterPickerItem = FilterPickerItems.Last();
10601060

1061+
if (ControlInformation is null)
1062+
return;
1063+
10611064
var items = await MauiControlsService.GetControlsAsync(ControlInformation.GroupName);
10621065
foreach (var item in items)
10631066
{

src/Core/MAUIsland.Core/Services/Controls/ControlsService.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ public ControlsService(IEnumerable<IGalleryCardInfo> controlInfos)
2323

2424
private readonly IList<ControlGroupInfo> controlGroupInfos = new List<ControlGroupInfo>()
2525
{
26-
new (){
27-
Name = ControlGroupInfo.SyncfusionControls,
28-
Title = "Syncfusion",
29-
Version = "23.1.36",
30-
BrandColor = Color.FromArgb("#ff8900"),
31-
ButtonTextColor = Colors.White,
32-
IconUrl = "syncfusionlogo.png",
33-
Author = "Syncfusion Inc.",
34-
Banner = "syncfusion_banner.png",
35-
ProviderUrl = "https://help.syncfusion.com/maui/introduction/overview",
36-
MicrosoftStoreLink="https://www.microsoft.com/store/productId/9P2P4D2BK270",
37-
Description = "Syncfusion is a company that provides a set of controls for creating beautiful cross-platform, native mobile & desktop apps using .NET Multi-platform App UI (.NET MAUI). They offer a comprehensive collection of .NET MAUI components such as Charts, Gauge, and Tab View. You can add Syncfusion .NET MAUI components to your project by installing them from nuget.org. They also have a Visual Studio extension designed to streamline the creation of .NET MAUI applications."
38-
},
26+
//new (){
27+
// Name = ControlGroupInfo.SyncfusionControls,
28+
// Title = "Syncfusion",
29+
// Version = "23.1.36",
30+
// BrandColor = Color.FromArgb("#ff8900"),
31+
// ButtonTextColor = Colors.White,
32+
// IconUrl = "syncfusionlogo.png",
33+
// Author = "Syncfusion Inc.",
34+
// Banner = "syncfusion_banner.png",
35+
// ProviderUrl = "https://help.syncfusion.com/maui/introduction/overview",
36+
// MicrosoftStoreLink="https://www.microsoft.com/store/productId/9P2P4D2BK270",
37+
// Description = "Syncfusion is a company that provides a set of controls for creating beautiful cross-platform, native mobile & desktop apps using .NET Multi-platform App UI (.NET MAUI). They offer a comprehensive collection of .NET MAUI components such as Charts, Gauge, and Tab View. You can add Syncfusion .NET MAUI components to your project by installing them from nuget.org. They also have a Visual Studio extension designed to streamline the creation of .NET MAUI applications."
38+
//},
3939
new (){
4040
Name = ControlGroupInfo.BuiltInControls,
4141
Title = "Built-in",

src/Presentations/Windows/Features/Gallery/Pages/BuiltIn/Controls/ActivityIndicator/ActivityIndicatorPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
TextDecorations="Underline" />
201201
<CollectionView
202202
Footer="{x:StaticResource PropertiesListFooter}"
203-
ItemsSource="{x:StaticResource PropertyItemsSource}"
203+
ItemsSource="{x:StaticResource PropertiesItemsSource}"
204204
Style="{x:StaticResource PropertiesListStyle}" />
205205
</VerticalStackLayout>
206206
</Border>

src/Presentations/Windows/Features/Gallery/Pages/BuiltIn/Controls/CheckBox/CheckBoxPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
<CheckBox IsChecked="{x:Binding IsChecked, Mode=TwoWay}" Color="{x:Binding CurrentColor, Mode=OneWay}" />
224224
<Label
225225
Text="{x:Binding IsChecked,
226+
Mode=OneWay,
226227
Converter={x:StaticResource StringTernaryOperatorConverter},
227228
ConverterParameter={x:StaticResource CheckBoxStateMessages}}"
228229
TextColor="{x:Binding CurrentColor,

src/Presentations/Windows/Features/Gallery/Pages/BuiltIn/Controls/CollectionView/CollectionViewPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
TextDecorations="Underline" />
438438
<CollectionView
439439
Footer="{x:StaticResource PropertiesListFooter}"
440-
ItemsSource="{x:StaticResource PropertyItemsSource}"
440+
ItemsSource="{x:StaticResource PropertiesItemsSource}"
441441
Style="{x:StaticResource PropertiesListStyle}" />
442442
</VerticalStackLayout>
443443
</Border>

src/Presentations/Windows/Features/Gallery/Pages/BuiltIn/Controls/CollectionView/CollectionViewPage.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ private void BasePage_Loaded(object sender, EventArgs e)
4040
{
4141
viewModel.SetControlInformation(NewWindowParameter);
4242
viewModel.RefreshCommand.Execute(null);
43+
viewModel.RefreshPageCommand.Execute(null);
4344
}
4445
}
4546

@@ -68,6 +69,10 @@ private void ViewModelSpanningNumberPropertyChanged(object sender, PropertyChang
6869
void OnFilterItemChanged(object sender, EventArgs e)
6970
{
7071
var picker = (Picker)sender;
72+
73+
if (picker.SelectedItem is null)
74+
return;
75+
7176
var selectedFilter = picker.SelectedItem.ToString();
7277

7378
var collectionView = CollectionViewItemLayoutChanged;

src/Presentations/Windows/Features/Gallery/Pages/BuiltIn/Controls/Entry/EntryPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
TextDecorations="Underline" />
292292
<CollectionView
293293
Footer="{x:StaticResource PropertiesListFooter}"
294-
ItemsSource="{x:StaticResource PropertyItemsSource}"
294+
ItemsSource="{x:StaticResource PropertiesItemsSource}"
295295
Style="{x:StaticResource PropertiesListStyle}" />
296296
</VerticalStackLayout>
297297
</Border>

0 commit comments

Comments
 (0)