.net 9 Maui CollectionView not showing data

I am using Microsoft Visual Studio Community 2022(64-bit) Version 17.12.3. I am also using CommunityToolkit.Mvvm. I have CasesPage.xaml, CasesPage.xaml.cs and CasesPageModel with ReportedCasesView.cs which is the Model file. I am trying to display a query result in a CollectionView but the data does not show up although the number of records retrieved is indicated. Below are the files and code I tried to achieve the results.

CasesPage.xaml file:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Bmcl.GhanaLawReport.Pages.CasesPage"
             xmlns:local="clr-namespace:Bmcl.GhanaLawReport.Services"
             xmlns:pagemodel="clr-namespace:Bmcl.GhanaLawReport.PageModels"
             x:DataType="pagemodel:CasesPageModel"
             xmlns:sfradiobutton="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons" 
             xmlns:inputLayout="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
             xmlns:editors="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
             xmlns:syncfusion="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
             Title="Reported Cases">

    
    <ContentPage.BindingContext>
        <pagemodel:CasesPageModel />
    </ContentPage.BindingContext>
    
    <ScrollView>
        <VerticalStackLayout>
            <Label Margin="10,0,10,0"
            Text="Ghana Law Reports"
            VerticalOptions="Center" 
            HorizontalOptions="Center" FontSize="Title" />

            <Image Source="ghanacoatofarms.png" HeightRequest="50" Aspect="AspectFit" />

            <StackLayout Margin="5">
                <sfradiobutton:SfRadioGroup x:Name="CasesGroup">
                    
                    <sfradiobutton:SfRadioButton 
                        x:Name="ReportYear" 
                        Text="Case By Report Year" 
                        CheckedColor="Red" 
                        UncheckedColor="Black" 
                        StateChanged="ReportYear_StateChanged"/>
                    
                    <!--Setting ItemsSource-->
                    <editors:SfComboBox x:Name="LawReportComboBox"
                                    WidthRequest="250"
                                    HeightRequest = "50"
                                    IsEnabled="False"
                                    DisplayMemberPath="ReportName"
                                    TextMemberPath="ReportName"
                                    ItemsSource="{Binding LawReportList}"
                                        SelectionChanged="LawReportComboBox_SelectionChanged"/>

                    <sfradiobutton:SfRadioButton
                        x:Name="AnyTextCaseTitle" 
                        Text="Case Title By Any Text" 
                        CheckedColor="Red" 
                        UncheckedColor="Black" 
                        StateChanged="AnyTextCaseTitle_StateChanged"/>

                    <Entry x:Name="CaseTitleEntry" 
                           IsEnabled="False" 
                           TextChanged="CaseTitleEntry_TextChanged"
                           Margin="30,0,10,0"/>
                   
                </sfradiobutton:SfRadioGroup>

            </StackLayout>
            <StackLayout Margin="10">
                <Button x:Name="Search" Text="Search"
                        BackgroundColor="Red"
                        TextColor="White"
                        Command="{Binding SearchCommand}"/>
            </StackLayout>
                    
            <VerticalStackLayout Margin="0,10,0,10">
                <Label Text="{Binding RecordsReturned}" 
                       TextColor="Red" FontSize="13" 
                       FontAttributes="Bold" 
                       VerticalTextAlignment="Center" 
                       HorizontalTextAlignment="Center"/>
            </VerticalStackLayout>
                    
            <!--ListView Area-->
            <CollectionView x:Name="CasesCollectionView" 
                            SelectionMode="Single" 
                            EmptyView="No Data" 
                            ItemsLayout="VerticalGrid"
                            ItemsSource="{Binding CaseTitlesList}">
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <VerticalStackLayout Padding="5" Margin="10" VerticalOptions="Center">
                        <Label Text="{Binding CaseName}" FontSize="Medium"/>
                        <Label Text="{Binding CourtName}" FontSize="Small"/>
                        <Label Text="{Binding ReportName}" FontSize="Small"/>
                    </VerticalStackLayout>
                </DataTemplate>
            </CollectionView.ItemTemplate>
            </CollectionView>
                    
                    
                    
                    
        </VerticalStackLayout>

    </ScrollView>
</ContentPage>

CasesPage.xaml.cs file

using Bmcl.GhanaLawReport.Models;
using Bmcl.GhanaLawReport.PageModels;
using Bmcl.GhanaLawReport.Services;

namespace Bmcl.GhanaLawReport.Pages;

public partial class CasesPage : ContentPage
{
    public CasesPage()
    {
        InitializeComponent();
    }

    private void ReportYear_StateChanged(object sender, Syncfusion.Maui.Buttons.StateChangedEventArgs e)
    {
        if(e.IsChecked.HasValue && e.IsChecked.Value)
        {
            AppProperties.ReportedCasesSearchOption = 1;
            LawReportComboBox.IsEnabled = true;
        }
        else
        {
            LawReportComboBox.IsEnabled = false;
        }
    }

    private void AnyTextCaseTitle_StateChanged(object sender, Syncfusion.Maui.Buttons.StateChangedEventArgs e)
    {
        if(e.IsChecked.HasValue && e.IsChecked.Value)
        { 
            AppProperties.ReportedCasesSearchOption = 2;
            CaseTitleEntry.IsEnabled = true; 
        }
        else
        { 
            CaseTitleEntry.IsEnabled = false; 
        }
    }

    private void CaseTitleEntry_TextChanged(object sender, TextChangedEventArgs e)
    {
        AppProperties.ReportedCasesAnyTextParameter = CaseTitleEntry.Text;
    }

    private void LawReportComboBox_SelectionChanged(object sender, Syncfusion.Maui.Inputs.SelectionChangedEventArgs e)
    {
        AppProperties.LawReportComboParameter = LawReportComboBox.Text;
    }

}

CasesPageModel.cs file (ViewModel if you like)

using Bmcl.GhanaLawReport.Models;
using Bmcl.GhanaLawReport.Services;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Collections.ObjectModel;

namespace Bmcl.GhanaLawReport.PageModels
{
    public partial class CasesPageModel : ObservableObject
    {
        private Int32 totalRecords = 0;

        [ObservableProperty]
        string recordsReturned = "";

        [ObservableProperty]
        ObservableCollection<ReportedCasesView> caseTitlesList = [];

        [ObservableProperty]
        ObservableCollection<LawReportIndexView> lawReportList = [];

        [ObservableProperty]
        int indexId = 0;

        [ObservableProperty]
        int caseId = 0;

        [ObservableProperty]
        int courtId = 0;

        [ObservableProperty]
        int reportId = 0;

        [ObservableProperty]
        string? caseName;

        [ObservableProperty]
        string? courtName;

        [ObservableProperty]
        string? reportName;

        [ObservableProperty]
        string? judges;

        public CasesPageModel()
        {
            GetLawReports();
        }

        private void GetLawReports()
        {
            var lawReports = Data.LawReport.ReadAllLawReports.Read();
            if (lawReports != null)
                LawReportList = new ObservableCollection<LawReportIndexView>(lawReports);
        }

        [RelayCommand]
        public async Task Search()
        {
            await GetSerchOptions();
        }

        private async Task GetSerchOptions()
        {
            switch(AppProperties.ReportedCasesSearchOption)
            {
                case 1:
                    if(AppProperties.LawReportComboParameter == string.Empty || 
                        AppProperties.LawReportComboParameter == null)
                    {
                        //--Message here
                        if(Application.Current?.Windows.Count > 0)
                        {
                            var page = Application.Current.Windows[0].Page;
                            if(page != null)
                            {
                                await page.DisplayAlert("Reported Case Error",
                                    "Please select a Law Report ", "OK");
                            }
                        }
                        return;
                    }

                    var caseTitles = await Data.ReportedCase.ReadCaseTitleByReport.ReadAsync(AppProperties.LawReportComboParameter);

                    if (caseTitles != null)
                    {
                        CaseTitlesList = new ObservableCollection<ReportedCasesView>(caseTitles);
                        totalRecords = caseTitles.Count;
                        RecordsReturned = $"Showing {totalRecords} Returned Records";
                    }

                    break;
                case 2:
                    if(AppProperties.ReportedCasesAnyTextParameter == string.Empty || 
                        AppProperties.ReportedCasesAnyTextParameter == null)
                    {
                        //--Message here
                        if(Application.Current?.Windows.Count > 0)
                        {
                            var page = Application.Current.Windows[0].Page;
                            if(page != null)
                            {
                                await page.DisplayAlert("Reported Case Error",
                                    "Please supply a Case Title ", "OK");
                            }
                        }
                        return;
                    }

                    var cases = await Data.ReportedCase.ReadCaseTitleByAnyText.ReadAsync(AppProperties.ReportedCasesAnyTextParameter);

                    if (cases != null)
                    {
                        CaseTitlesList = new ObservableCollection<ReportedCasesView>(cases);
                        totalRecords = cases.Count;
                        RecordsReturned = $"Showing {totalRecords} Returned Records";
                    }
                    break;
            }
        }
    }
}

ReportedCasesView (Model file)

namespace Bmcl.GhanaLawReport.Models
{
    public class ReportedCasesView
    {
        public int IndexId { get; set; }
        public int CaseId { get; set; }
        public int CourtId { get; set; }
        public int ReportId { get; set; }
        public string? CaseName { get; set; }
        public string? CourtName { get; set; }
        public string? ReportName { get; set; }
        public string? Judges { get; set; }
    }
}

What I want to achieve is very simple. For the queried data’s result to be displayed the CollectionView.

Thank you in advance for your help.

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật