I'll scan the entire project to analyze the structure and document common MAUI controls and patterns used.
Now I'll create a comprehensive guide document for you.
Project Name: CERS (Candidate Expenditure Reporting System)
Framework: .NET 8.0 MAUI
Platforms: Android, iOS, Windows, MacCatalyst
Key Dependencies: SQLite, Newtonsoft.Json
cers-maui-base/
├── App.xaml # Global resources & styles
├── App.xaml.cs # App initialization logic
├── AppShell.xaml # Shell navigation container
├── MauiProgram.cs # Dependency injection setup
├── Pages (XAML files):
│ ├── LoginPage.xaml # Login with OTP
│ ├── DashboardPage.xaml # Main dashboard
│ ├── AddExpenditureDetailsPage.xaml
│ ├── EditExpenditureDetailsPage.xaml
│ ├── ViewExpenditureDetailsPage.xaml
│ ├── MorePage.xaml # Settings/About
│ └── ChangeLanguagePage.xaml
├── Models/ # Data models & SQLite databases
├── Observer/ # Observer-specific logic
├── WebApi/ # API communication
└── Resources/
├── Images/ # PNG/SVG images
├── Fonts/ # Custom fonts
└── Styles/ # Additional styles
<!-- Light Theme -->
Light_Btn_Background_Color: #0f0f0f
Light_Grid_Background_tab_Color: #90a3f0
<!-- Dark Theme -->
Dark_Btn_Background_Color: #0f0f0f
Dark_Grid_Background_Color: #4F4B4B
ButtonStyle - Standard buttonsDanger_ButtonStyle - Delete/danger buttonsLabelStyle - Standard labelsLabelStyle_TabMenu - Bottom tab labelsFooterGridStyle - Bottom navigation barNavigationLabelColor - Platform-specific title colors<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CERS.YourPage"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="true">
Key Properties: BackgroundColor, Title, Padding
<Grid RowDefinitions="Auto,*,Auto" ColumnDefinitions="*,2*">
<Label Grid.Row="0" Grid.Column="0" Text="Header"/>
<Label Grid.Row="1" Grid.Column="1" Text="Content"/>
</Grid>
Key Properties:
- RowDefinitions: Auto (fit content), * (fill space), 100 (fixed)
- ColumnDefinitions: Same as rows
- RowSpacing, ColumnSpacing, Margin, Padding
<StackLayout Orientation="Vertical" Spacing="10" Margin="15">
<Label Text="Item 1"/>
<Label Text="Item 2"/>
</StackLayout>
Key Properties: Orientation (Vertical/Horizontal), Spacing, Padding
<ScrollView VerticalOptions="FillAndExpand">
<StackLayout>
<!-- Long content here -->
</StackLayout>
</ScrollView>
Key Properties: Orientation, VerticalScrollBarVisibility
<Label Text="Hello World"
FontSize="16"
FontAttributes="Bold"
TextColor="Navy"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
TextDecorations="Underline"
LineBreakMode="WordWrap"/>
Key Properties: Text, FontSize, FontAttributes (Bold/Italic), TextColor, HorizontalTextAlignment, VerticalTextAlignment
<Entry x:Name="entry_mobileno"
Placeholder="Enter Mobile No."
PlaceholderColor="Gray"
TextColor="Black"
Keyboard="Numeric"
MaxLength="10"
IsPassword="False"/>
Key Properties: Placeholder, Keyboard (Numeric/Email/Text), MaxLength, IsPassword
<Editor x:Name="entry_remarks"
Placeholder="Enter Remarks"
AutoSize="TextChanges"
FontSize="16"
MaxLength="200"/>
Key Properties: AutoSize (TextChanges), MaxLength, Placeholder
<Button x:Name="btn_save"
Text="Save"
FontSize="18"
FontAttributes="Bold"
BackgroundColor="Navy"
TextColor="White"
CornerRadius="25"
Clicked="btn_save_Clicked"
Padding="15,10"/>
Key Properties: Text, Clicked (event handler), CornerRadius, BackgroundColor, Command (MVVM)
<DatePicker x:Name="datepicker_expdate"
Format="dd/MM/yyyy"
DateSelected="datepicker_expdate_DateSelected"
FontSize="16"/>
Key Properties: Format, DateSelected (event), MinimumDate, MaximumDate
<Picker x:Name="picker_payMode"
Title="Select Payment Mode"
FontSize="16"
SelectedIndexChanged="picker_payMode_SelectedIndexChanged"/>
In Code-Behind:
picker_payMode.ItemsSource = new List<string> { "Cash", "Cheque", "Online" };
picker_payMode.SelectedIndex = 0;
<RadioButton x:Name="rb_exptype"
Content="By Type"
IsChecked="true"
GroupName="expgroup"
CheckedChanged="rb_exp_CheckedChanged"
FontSize="16"/>
Key Properties: GroupName (groups buttons), IsChecked, Content
<ListView x:Name="listView_expendituredetails"
HasUnevenRows="True"
SeparatorColor="Transparent"
SelectionMode="None"
ItemTapped="listView_ItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="4">
<Label Text="{Binding displaytitle}" FontSize="16"/>
<Label Text="{Binding amount}" FontSize="16"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Key Properties: ItemsSource (set in code), HasUnevenRows, SelectionMode
<CollectionView x:Name="listView_expendituredetails"
SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<Border Stroke="Navy" StrokeThickness="1" BackgroundColor="White">
<Border.StrokeShape>
<RoundRectangle CornerRadius="20"/>
</Border.StrokeShape>
<StackLayout Padding="15">
<Label Text="{Binding ExpTypeName}" FontSize="14"/>
</StackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Better performance than ListView
<Border BackgroundColor="White"
Stroke="#07a6db"
StrokeThickness="2"
Padding="15"
Shadow="{Shadow Brush=Black, Offset='0,2', Radius=10, Opacity=0.3}">
<Border.StrokeShape>
<RoundRectangle CornerRadius="15"/>
</Border.StrokeShape>
<!-- Content here -->
</Border>
Key Properties: Stroke (border color), StrokeThickness, Shadow
<Frame CornerRadius="10"
BorderColor="Silver"
Padding="10"
Margin="5">
<!-- Content -->
</Frame>
Note: Border is preferred in modern MAUI
<Image Source="ic_launcher.png"
HeightRequest="120"
Aspect="AspectFit"
HorizontalOptions="Center"/>
Key Properties: Source, Aspect (AspectFit/AspectFill/Fill), HeightRequest, WidthRequest
<SearchBar x:Name="searchbar_expendituredetails"
Placeholder="Search"
CancelButtonColor="Red"
TextChanged="searchbar_TextChanged"/>
<ActivityIndicator IsVisible="true"
IsRunning="true"
Color="Navy"/>
<BoxView BackgroundColor="SkyBlue"
HeightRequest="2"
HorizontalOptions="Fill"/>
Common Use: Divider lines
<Grid>
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="Tab_Home_Tapped"/>
</Grid.GestureRecognizers>
<Label Text="Tap Me"/>
</Grid>
<NavigationPage.TitleView>
<Grid ColumnDefinitions="Auto,*">
<Image Grid.Column="0" Source="seclogo.png" HeightRequest="40"/>
<Label Grid.Column="1" Text="Title" Style="{StaticResource NavigationLabelColor}"/>
</Grid>
</NavigationPage.TitleView>
<Grid Style="{StaticResource FooterGridStyle}" ColumnDefinitions="*,*,*">
<Grid Grid.Column="0">
<Grid.GestureRecognizers>
<TapGestureRecognizer Tapped="Tab_Home_Tapped"/>
</Grid.GestureRecognizers>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="ic_homewhite.png" HeightRequest="20"/>
<Label Grid.Row="1" Text="Home" Style="{StaticResource LabelStyle_TabMenu}"/>
</Grid>
<!-- Repeat for other tabs -->
</Grid>
<Grid x:Name="Loading_activity"
Grid.RowSpan="4"
BackgroundColor="#C0808080"
IsVisible="false"
ZIndex="1000">
<Border BackgroundColor="White" Padding="20">
<HorizontalStackLayout Spacing="10">
<ActivityIndicator IsRunning="true" Color="Navy"/>
<Label Text="Please Wait..." FontAttributes="Bold"/>
</HorizontalStackLayout>
</Border>
</Grid>
In Code-Behind:
Loading_activity.IsVisible = true; // Show
Loading_activity.IsVisible = false; // Hide
<ContentView x:Name="popupDetails"
BackgroundColor="#C0808080"
IsVisible="false"
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All">
<Frame BorderColor="#0596f7" CornerRadius="15" Padding="10">
<!-- Popup content -->
<Button Text="Close" Clicked="ClosePopup_Clicked"/>
</Frame>
</ContentView>
entry_mobileno.Text = "1234567890";
lbl_heading.Text = "Dashboard";
btn_save.IsEnabled = false;
Loading_activity.IsVisible = true;
private void btn_save_Clicked(object sender, EventArgs e)
{
string mobile = entry_mobileno.Text;
// Your logic
}
private void datepicker_expdate_DateSelected(object sender, DateChangedEventArgs e)
{
DateTime selected = e.NewDate;
}
listView_expendituredetails.ItemsSource = myDataList;
<Label x:Name="lbl_newfield" Text="New Field*" FontSize="16" FontAttributes="Bold"/>
<Entry x:Name="entry_newfield" Placeholder="Enter value" FontSize="16"/>
string value = entry_newfield.Text;
x:Name in XAML<Button BackgroundColor="Red" TextColor="White"/>
<Style x:Key="MyButtonStyle" TargetType="Button">
<Setter Property="BackgroundColor" Value="Navy"/>
</Style>
Start - Align left/topCenter - CenterEnd - Align right/bottomFill - Stretch to fillFillAndExpand - Fill and take extra spaceStart, Center, End<!-- One-way binding -->
<Label Text="{Binding PropertyName}"/>
<!-- Two-way binding -->
<Entry Text="{Binding PropertyName, Mode=TwoWay}"/>
<!-- Visibility binding -->
<StackLayout IsVisible="{Binding IsVisible}"/>
Clicked eventsKey Files to Edit: - .xaml - UI structure - .xaml.cs - Logic and event handlers - App.xaml - Global styles and colors
This structure allows you to copy controls, modify properties, and understand where each piece fits in the application.