Skip to content

Commit 3a03582

Browse files
committed
Revert "Enhance maui-mobile developer sample with recent updates (#31151)"
This reverts commit 2e9707c.
1 parent 2e9707c commit 3a03582

File tree

21 files changed

+71
-300
lines changed

21 files changed

+71
-300
lines changed

src/Templates/build.ps1

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ param (
66
[Parameter(Mandatory=$false, HelpMessage="Specify the path to the template project to build")]
77
[string]$templatesProjectPath = "src\Microsoft.Maui.Templates.csproj",
88
[Parameter(Mandatory=$false, HelpMessage="Specify whether to start Visual Studio (Code) after creating the new project with the latest template changes")]
9-
[bool]$startVsAfterBuild = $true,
10-
[Parameter(Mandatory=$false, HelpMessage="Additional arguments to pass to the dotnet new command (e.g., '--sample-content')")]
11-
[string]$additionalProjectArgs = ""
9+
[bool]$startVsAfterBuild = $true
1210
)
1311

1412
# Source the utils script for some common functionalities
@@ -41,11 +39,7 @@ Empty-UserHomeTemplateEngineFolder
4139
dotnet new install $nupkgPath.FullName
4240

4341
# Create a new dotnet project using the specified project type
44-
if ($additionalProjectArgs) {
45-
dotnet new $projectType $additionalProjectArgs -o ./.tempTemplateOutput/NewProject --force
46-
} else {
47-
dotnet new $projectType -o ./.tempTemplateOutput/NewProject --force
48-
}
42+
dotnet new $projectType -o ./.tempTemplateOutput/NewProject --force
4943

5044
if ($startVsAfterBuild -eq $false) {
5145
exit 0

src/Templates/src/templates/maui-mobile/.template.config/template.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
{
6161
"condition": "(!IncludeSampleContent)",
6262
"exclude": [
63-
"Converter/**",
6463
"Data/**",
6564
"GlobalUsings.cs",
6665
"Messages/**",
@@ -73,8 +72,7 @@
7372
"Resources/Fonts/FluentUI.cs",
7473
"Services/**",
7574
"Resources/Styles/AppStyles.xaml",
76-
"Utilities/**",
77-
"Platforms/iOS/SemanticScreenReaderAsyncImplementation.cs"
75+
"Utilities/**"
7876
]
7977
},
8078
{

src/Templates/src/templates/maui-mobile/App.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Microsoft.Extensions.DependencyInjection;
2-
3-
namespace MauiApp._1;
1+
namespace MauiApp._1;
42

53
public partial class App : Application
64
{

src/Templates/src/templates/maui-mobile/Converter/DataLabelValueConverter.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Templates/src/templates/maui-mobile/MauiProgram.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ public static MauiApp CreateMauiApp()
5050
builder.Services.AddSingleton<MainPageModel>();
5151
builder.Services.AddSingleton<ProjectListPageModel>();
5252
builder.Services.AddSingleton<ManageMetaPageModel>();
53-
#if IOS
54-
builder.Services.AddSingleton<IAsyncAnnouncement, SemanticScreenReaderAsyncImplementation>();
55-
#endif
5653

5754
builder.Services.AddTransientWithShellRoute<ProjectDetailPage, ProjectDetailPageModel>("project");
5855
builder.Services.AddTransientWithShellRoute<TaskDetailPage, TaskDetailPageModel>("task");

src/Templates/src/templates/maui-mobile/Models/Project.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ public class Project
1818

1919
public List<Tag> Tags { get; set; } = [];
2020

21-
public string AccessibilityDescription
22-
{
23-
get { return $"{Name} Project. {Description}"; }
24-
}
25-
26-
public override string ToString() => $"{Name}";
21+
public override string ToString() => $"{Name}";
2722
}
2823

2924
public class ProjectsJson

src/Templates/src/templates/maui-mobile/PageModels/ManageMetaPageModel.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ private async Task SaveCategories()
4747
}
4848

4949
await AppShell.DisplayToastAsync("Categories saved");
50-
await AnnouncementHelper.Announce("Categories saved");
5150
}
5251

5352
[RelayCommand]
@@ -56,7 +55,6 @@ private async Task DeleteCategory(Category category)
5655
Categories.Remove(category);
5756
await _categoryRepository.DeleteItemAsync(category);
5857
await AppShell.DisplayToastAsync("Category deleted");
59-
await AnnouncementHelper.Announce("Category deleted");
6058
}
6159

6260
[RelayCommand]
@@ -66,7 +64,6 @@ private async Task AddCategory()
6664
Categories.Add(category);
6765
await _categoryRepository.SaveItemAsync(category);
6866
await AppShell.DisplayToastAsync("Category added");
69-
await AnnouncementHelper.Announce("Category added");
7067
}
7168

7269
[RelayCommand]
@@ -78,7 +75,6 @@ private async Task SaveTags()
7875
}
7976

8077
await AppShell.DisplayToastAsync("Tags saved");
81-
await AnnouncementHelper.Announce("Tags saved");
8278
}
8379

8480
[RelayCommand]
@@ -87,7 +83,6 @@ private async Task DeleteTag(Tag tag)
8783
Tags.Remove(tag);
8884
await _tagRepository.DeleteItemAsync(tag);
8985
await AppShell.DisplayToastAsync("Tag deleted");
90-
await AnnouncementHelper.Announce("Tags deleted");
9186
}
9287

9388
[RelayCommand]
@@ -97,7 +92,6 @@ private async Task AddTag()
9792
Tags.Add(tag);
9893
await _tagRepository.SaveItemAsync(tag);
9994
await AppShell.DisplayToastAsync("Tag added");
100-
await AnnouncementHelper.Announce("Tags added");
10195
}
10296

10397
[RelayCommand]
@@ -108,4 +102,4 @@ private async Task Reset()
108102
Preferences.Default.Set("is_seeded", true);
109103
await Shell.Current.GoToAsync("//main");
110104
}
111-
}
105+
}

src/Templates/src/templates/maui-mobile/PageModels/ProjectDetailPageModel.cs

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,7 @@ public partial class ProjectDetailPageModel : ObservableObject, IQueryAttributab
5252
new IconData { Icon = FluentUI.bot_24_regular, Description = "Bot Icon" }
5353
};
5454

55-
private bool _canDelete;
56-
57-
public bool CanDelete
58-
{
59-
get => _canDelete;
60-
set
61-
{
62-
_canDelete = value;
63-
DeleteCommand.NotifyCanExecuteChanged();
64-
}
65-
}
66-
67-
public bool HasCompletedTasks
55+
public bool HasCompletedTasks
6856
=> _project?.Tasks.Any(t => t.IsCompleted) ?? false;
6957

7058
public ProjectDetailPageModel(ProjectRepository projectRepository, TaskRepository taskRepository, CategoryRepository categoryRepository, TagRepository tagRepository, ModalErrorHandler errorHandler)
@@ -157,8 +145,7 @@ private async Task LoadData(int id)
157145
finally
158146
{
159147
IsBusy = false;
160-
CanDelete = !_project.IsNullOrNew();
161-
OnPropertyChanged(nameof(HasCompletedTasks));
148+
OnPropertyChanged(nameof(HasCompletedTasks));
162149
}
163150
}
164151

@@ -230,7 +217,7 @@ await Shell.Current.GoToAsync($"task",
230217
});
231218
}
232219

233-
[RelayCommand(CanExecute = nameof(CanDelete))]
220+
[RelayCommand]
234221
private async Task Delete()
235222
{
236223
if (_project.IsNullOrNew())
@@ -258,26 +245,14 @@ private async Task ToggleTag(Tag tag)
258245
if (tag.IsSelected)
259246
{
260247
await _tagRepository.SaveItemAsync(tag, _project.ID);
261-
AllTags = new(AllTags);
262-
await AnnouncementHelper.Announce($"{tag.Title} selected");
263248
}
264249
else
265250
{
266251
await _tagRepository.DeleteItemAsync(tag, _project.ID);
267-
AllTags = new(AllTags);
268-
await AnnouncementHelper.Announce($"{tag.Title} unselected");
269252
}
270253
}
271-
else
272-
{
273-
AllTags = new(AllTags);
274-
}
275-
}
276254

277-
[RelayCommand]
278-
private async Task IconSelected(IconData icon)
279-
{
280-
await AnnouncementHelper.Announce($"{icon.Description} selected");
255+
AllTags = new(AllTags);
281256
}
282257

283258
[RelayCommand]

src/Templates/src/templates/maui-mobile/Pages/Controls/CategoryChart.xaml

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,46 @@
55
xmlns:controls="clr-namespace:MauiApp._1.Pages.Controls"
66
xmlns:shimmer="clr-namespace:Syncfusion.Maui.Toolkit.Shimmer;assembly=Syncfusion.Maui.Toolkit"
77
xmlns:pageModels="clr-namespace:MauiApp._1.PageModels"
8-
xmlns:models="clr-namespace:MauiApp._1.Models"
9-
xmlns:converter="clr-namespace:MauiApp._1.Converter"
108
x:Class="MauiApp._1.Pages.Controls.CategoryChart"
11-
x:DataType="pageModels:MainPageModel"
129
HeightRequest="{OnIdiom 300, Phone=200}"
1310
Margin="0, 12"
14-
Style="{StaticResource CardStyle}">
11+
Style="{StaticResource CardStyle}"
12+
x:DataType="pageModels:MainPageModel">
1513
<shimmer:SfShimmer
16-
AutomationProperties.IsInAccessibleTree="False"
1714
BackgroundColor="Transparent"
18-
VerticalOptions="Fill"
19-
x:DataType="pageModels:MainPageModel"
20-
IsActive="{Binding IsBusy}">
15+
VerticalOptions="FillAndExpand"
16+
IsActive ="{Binding IsBusy}">
2117
<shimmer:SfShimmer.CustomView>
2218
<Grid>
23-
<BoxView
19+
<BoxView
2420
CornerRadius="12"
25-
VerticalOptions="Fill"
21+
VerticalOptions="FillAndExpand"
2622
Style="{StaticResource ShimmerCustomViewStyle}"/>
2723
</Grid>
2824
</shimmer:SfShimmer.CustomView>
2925
<shimmer:SfShimmer.Content>
30-
<chart:SfCircularChart x:Name="Chart"
31-
SemanticProperties.Description="Task Categories Chart">
32-
<chart:SfCircularChart.Resources>
33-
<converter:DataLabelValueConverter x:Key="valueConverter"/>
34-
</chart:SfCircularChart.Resources>
35-
<chart:DoughnutSeries
36-
x:DataType="pageModels:MainPageModel"
26+
<chart:SfCircularChart x:Name="Chart">
27+
<chart:SfCircularChart.Legend>
28+
<controls:LegendExt Placement="Right">
29+
<chart:ChartLegend.LabelStyle>
30+
<chart:ChartLegendLabelStyle
31+
TextColor="{AppThemeBinding
32+
Light={StaticResource DarkOnLightBackground},
33+
Dark={StaticResource LightOnDarkBackground}}"
34+
Margin="5"
35+
FontSize="18" />
36+
</chart:ChartLegend.LabelStyle>
37+
</controls:LegendExt>
38+
</chart:SfCircularChart.Legend>
39+
<chart:RadialBarSeries
3740
ItemsSource="{Binding TodoCategoryData}"
3841
PaletteBrushes="{Binding TodoCategoryColors}"
3942
XBindingPath="Title"
40-
YBindingPath="Count"
43+
YBindingPath="Count"
4144
ShowDataLabels="True"
42-
EnableTooltip="False"
43-
x:Name="doughnutSeries"
44-
Radius="{OnIdiom 0.6, Phone=0.5}"
45-
InnerRadius="0.7">
46-
<chart:DoughnutSeries.LabelTemplate>
47-
<DataTemplate>
48-
<HorizontalStackLayout x:DataType="chart:ChartDataLabel">
49-
<Label Text="{Binding Item, Converter={StaticResource valueConverter}, ConverterParameter='Title'}"
50-
TextColor="{AppThemeBinding
51-
Light={StaticResource DarkOnLightBackground},
52-
Dark={StaticResource LightOnDarkBackground}}"
53-
FontSize="{OnIdiom 18, Phone=14}"/>
54-
<Label Text=": "
55-
TextColor="{AppThemeBinding
56-
Light={StaticResource DarkOnLightBackground},
57-
Dark={StaticResource LightOnDarkBackground}}"
58-
FontSize="{OnIdiom 18, Phone=14}"/>
59-
<Label Text="{Binding Item, Converter={StaticResource valueConverter}, ConverterParameter='Count'}"
60-
TextColor="{AppThemeBinding
61-
Light={StaticResource DarkOnLightBackground},
62-
Dark={StaticResource LightOnDarkBackground}}"
63-
FontSize="{OnIdiom 18, Phone=14}"/>
64-
</HorizontalStackLayout>
65-
</DataTemplate>
66-
</chart:DoughnutSeries.LabelTemplate>
67-
68-
<chart:DoughnutSeries.DataLabelSettings>
69-
<chart:CircularDataLabelSettings LabelPosition="Outside"
70-
SmartLabelAlignment="Shift">
71-
<chart:CircularDataLabelSettings.ConnectorLineSettings>
72-
<chart:ConnectorLineStyle ConnectorType="Line"
73-
StrokeWidth="3"></chart:ConnectorLineStyle>
74-
</chart:CircularDataLabelSettings.ConnectorLineSettings>
75-
</chart:CircularDataLabelSettings>
76-
</chart:DoughnutSeries.DataLabelSettings>
77-
</chart:DoughnutSeries>
78-
45+
EnableTooltip="True"
46+
TrackFill="{AppThemeBinding Light={StaticResource LightBackground}, Dark={StaticResource DarkBackground}}"
47+
CapStyle = "BothCurve"/>
7948
</chart:SfCircularChart>
8049
</shimmer:SfShimmer.Content>
8150
</shimmer:SfShimmer>

src/Templates/src/templates/maui-mobile/Pages/Controls/ProjectCardView.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
xmlns:pageModels="clr-namespace:MauiApp._1.PageModels"
88
xmlns:shimmer="clr-namespace:Syncfusion.Maui.Toolkit.Shimmer;assembly=Syncfusion.Maui.Toolkit"
99
x:Class="MauiApp._1.Pages.Controls.ProjectCardView"
10-
SemanticProperties.Description="{Binding AccessibilityDescription}"
1110
Style="{StaticResource CardStyle}"
1211
x:DataType="models:Project">
1312
<shimmer:SfShimmer
1413
BackgroundColor="Transparent"
15-
VerticalOptions="Fill"
14+
VerticalOptions="FillAndExpand"
1615
IsActive="{Binding IsBusy, Source={RelativeSource AncestorType={x:Type pageModels:MainPageModel}}, x:DataType=pageModels:IProjectTaskPageModel}">
1716
<shimmer:SfShimmer.CustomView>
1817
<VerticalStackLayout Spacing="15">
@@ -46,7 +45,7 @@
4645
Size="{StaticResource IconSize}"/>
4746
</Image.Source>
4847
</Image>
49-
<Label Text="{Binding Name}" TextColor="{AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray400}}" FontSize="14" TextTransform="Uppercase"/>
48+
<Label Text="{Binding Name}" TextColor="{StaticResource Gray400}" FontSize="14" TextTransform="Uppercase"/>
5049
<Label Text="{Binding Description}" LineBreakMode="WordWrap"/>
5150
<HorizontalStackLayout Spacing="15" BindableLayout.ItemsSource="{Binding Tags}">
5251
<BindableLayout.ItemTemplate>

0 commit comments

Comments
 (0)