├── Resources ├── Images │ ├── user.png │ ├── clear.png │ ├── search.png │ └── dotnet_bot.svg ├── Fonts │ ├── OpenSans-Regular.ttf │ └── OpenSans-Semibold.ttf ├── AppIcon │ ├── appicon.svg │ └── appiconfg.svg ├── Raw │ └── AboutAssets.txt ├── Splash │ └── splash.svg └── Styles │ ├── Colors.xaml │ └── Styles.xaml ├── Properties └── launchSettings.json ├── App.xaml.cs ├── Platforms ├── Android │ ├── Resources │ │ └── values │ │ │ └── colors.xml │ ├── MainApplication.cs │ ├── AndroidManifest.xml │ └── MainActivity.cs ├── iOS │ ├── AppDelegate.cs │ ├── Program.cs │ └── Info.plist ├── MacCatalyst │ ├── AppDelegate.cs │ ├── Program.cs │ └── Info.plist ├── Windows │ ├── App.xaml │ ├── app.manifest │ ├── App.xaml.cs │ └── Package.appxmanifest └── Tizen │ ├── Main.cs │ └── tizen-manifest.xml ├── AppShell.xaml.cs ├── Views ├── AddUpdateStudentDetail.xaml.cs ├── StudentListPage.xaml.cs ├── AddUpdateStudentDetail.xaml └── StudentListPage.xaml ├── AppShell.xaml ├── MainPage.xaml.cs ├── Services ├── IStudentService.cs └── StudentService.cs ├── Models └── StudentModel.cs ├── App.xaml ├── MauiProgram.cs ├── SQLiteDemo.sln ├── SearchHandlers └── StudentSearchHandler.cs ├── MainPage.xaml ├── ViewModels ├── AddUpdateStudentDetailViewModel.cs └── StudentListPageViewModel.cs ├── .gitattributes ├── SQLiteDemo.csproj └── .gitignore /Resources/Images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mistrypragnesh40/SQLiteDemoMAUI/HEAD/Resources/Images/user.png -------------------------------------------------------------------------------- /Resources/Images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mistrypragnesh40/SQLiteDemoMAUI/HEAD/Resources/Images/clear.png -------------------------------------------------------------------------------- /Resources/Images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mistrypragnesh40/SQLiteDemoMAUI/HEAD/Resources/Images/search.png -------------------------------------------------------------------------------- /Resources/Fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mistrypragnesh40/SQLiteDemoMAUI/HEAD/Resources/Fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /Resources/Fonts/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mistrypragnesh40/SQLiteDemoMAUI/HEAD/Resources/Fonts/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Windows Machine": { 4 | "commandName": "MsixPackage", 5 | "nativeDebugging": false 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace SQLiteDemo; 2 | 3 | public partial class App : Application 4 | { 5 | public App() 6 | { 7 | InitializeComponent(); 8 | 9 | MainPage = new AppShell(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Platforms/Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #512BD4 4 | #2B0B98 5 | #2B0B98 6 | -------------------------------------------------------------------------------- /Resources/AppIcon/appicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Platforms/iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace SQLiteDemo; 4 | 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | -------------------------------------------------------------------------------- /Platforms/MacCatalyst/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace SQLiteDemo; 4 | 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | -------------------------------------------------------------------------------- /AppShell.xaml.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.Views; 2 | 3 | namespace SQLiteDemo; 4 | 5 | public partial class AppShell : Shell 6 | { 7 | public AppShell() 8 | { 9 | InitializeComponent(); 10 | 11 | Routing.RegisterRoute(nameof(AddUpdateStudentDetail), typeof(AddUpdateStudentDetail)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Platforms/Windows/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Views/AddUpdateStudentDetail.xaml.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.ViewModels; 2 | 3 | namespace SQLiteDemo.Views; 4 | 5 | public partial class AddUpdateStudentDetail : ContentPage 6 | { 7 | public AddUpdateStudentDetail(AddUpdateStudentDetailViewModel viewModel) 8 | { 9 | InitializeComponent(); 10 | this.BindingContext = viewModel; 11 | } 12 | } -------------------------------------------------------------------------------- /Platforms/Tizen/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Maui; 3 | using Microsoft.Maui.Hosting; 4 | 5 | namespace SQLiteDemo; 6 | 7 | class Program : MauiApplication 8 | { 9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 10 | 11 | static void Main(string[] args) 12 | { 13 | var app = new Program(); 14 | app.Run(args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Platforms/Android/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Runtime; 3 | 4 | namespace SQLiteDemo; 5 | 6 | [Application] 7 | public class MainApplication : MauiApplication 8 | { 9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership) 10 | : base(handle, ownership) 11 | { 12 | } 13 | 14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 15 | } 16 | -------------------------------------------------------------------------------- /Platforms/iOS/Program.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace SQLiteDemo; 5 | 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Platforms/MacCatalyst/Program.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace SQLiteDemo; 5 | 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Platforms/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Platforms/Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | 5 | namespace SQLiteDemo; 6 | 7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] 8 | public class MainActivity : MauiAppCompatActivity 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /AppShell.xaml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace SQLiteDemo; 2 | 3 | public partial class MainPage : ContentPage 4 | { 5 | int count = 0; 6 | 7 | public MainPage() 8 | { 9 | InitializeComponent(); 10 | } 11 | 12 | private void OnCounterClicked(object sender, EventArgs e) 13 | { 14 | count++; 15 | 16 | if (count == 1) 17 | CounterBtn.Text = $"Clicked {count} time"; 18 | else 19 | CounterBtn.Text = $"Clicked {count} times"; 20 | 21 | SemanticScreenReader.Announce(CounterBtn.Text); 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Services/IStudentService.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SQLiteDemo.Services 9 | { 10 | public interface IStudentService 11 | { 12 | Task> GetStudentList(); 13 | Task AddStudent(StudentModel studentModel); 14 | Task DeleteStudent(StudentModel studentModel); 15 | Task UpdateStudent(StudentModel studentModel); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Views/StudentListPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.ViewModels; 2 | 3 | namespace SQLiteDemo.Views; 4 | 5 | public partial class StudentListPage : ContentPage 6 | { 7 | private StudentListPageViewModel _viewMode; 8 | public StudentListPage(StudentListPageViewModel viewModel) 9 | { 10 | InitializeComponent(); 11 | _viewMode = viewModel; 12 | this.BindingContext = viewModel; 13 | } 14 | 15 | protected override void OnAppearing() 16 | { 17 | base.OnAppearing(); 18 | _viewMode.GetStudentListCommand.Execute(null); 19 | } 20 | } -------------------------------------------------------------------------------- /Models/StudentModel.cs: -------------------------------------------------------------------------------- 1 | using SQLite; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SQLiteDemo.Models 9 | { 10 | public class StudentModel 11 | { 12 | [PrimaryKey, AutoIncrement] 13 | public int StudentID { get; set; } 14 | public string FirstName { get; set; } 15 | public string LastName { get; set; } 16 | public string Email { get; set; } 17 | [Ignore] 18 | public string FullName => $"{FirstName} {LastName}"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Resources/Raw/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories). Deployment of the asset to your application 3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. 4 | 5 | 6 | 7 | These files will be deployed with you package and will be accessible using Essentials: 8 | 9 | async Task LoadMauiAsset() 10 | { 11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); 12 | using var reader = new StreamReader(stream); 13 | 14 | var contents = reader.ReadToEnd(); 15 | } 16 | -------------------------------------------------------------------------------- /Platforms/Tizen/tizen-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | appicon.xhigh.png 7 | 8 | 9 | 10 | 11 | http://tizen.org/privilege/internet 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Platforms/Windows/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | true/PM 12 | PerMonitorV2, PerMonitor 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Platforms/Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | 3 | // To learn more about WinUI, the WinUI project structure, 4 | // and more about our project templates, see: http://aka.ms/winui-project-info. 5 | 6 | namespace SQLiteDemo.WinUI; 7 | 8 | /// 9 | /// Provides application-specific behavior to supplement the default Application class. 10 | /// 11 | public partial class App : MauiWinUIApplication 12 | { 13 | /// 14 | /// Initializes the singleton application object. This is the first line of authored code 15 | /// executed, and as such is the logical equivalent of main() or WinMain(). 16 | /// 17 | public App() 18 | { 19 | this.InitializeComponent(); 20 | } 21 | 22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Platforms/MacCatalyst/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UIRequiredDeviceCapabilities 11 | 12 | arm64 13 | 14 | UISupportedInterfaceOrientations 15 | 16 | UIInterfaceOrientationPortrait 17 | UIInterfaceOrientationLandscapeLeft 18 | UIInterfaceOrientationLandscapeRight 19 | 20 | UISupportedInterfaceOrientations~ipad 21 | 22 | UIInterfaceOrientationPortrait 23 | UIInterfaceOrientationPortraitUpsideDown 24 | UIInterfaceOrientationLandscapeLeft 25 | UIInterfaceOrientationLandscapeRight 26 | 27 | XSAppIconAssets 28 | Assets.xcassets/appicon.appiconset 29 | 30 | 31 | -------------------------------------------------------------------------------- /MauiProgram.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.Services; 2 | using SQLiteDemo.ViewModels; 3 | using SQLiteDemo.Views; 4 | 5 | namespace SQLiteDemo; 6 | 7 | public static class MauiProgram 8 | { 9 | public static MauiApp CreateMauiApp() 10 | { 11 | var builder = MauiApp.CreateBuilder(); 12 | builder 13 | .UseMauiApp() 14 | .ConfigureFonts(fonts => 15 | { 16 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); 17 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); 18 | }); 19 | 20 | // Services 21 | builder.Services.AddSingleton(); 22 | 23 | 24 | //Views Registration 25 | builder.Services.AddSingleton(); 26 | builder.Services.AddTransient(); 27 | 28 | 29 | //View Modles 30 | builder.Services.AddSingleton(); 31 | builder.Services.AddTransient(); 32 | 33 | 34 | return builder.Build(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Platforms/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSRequiresIPhoneOS 6 | 7 | UIDeviceFamily 8 | 9 | 1 10 | 2 11 | 12 | UIRequiredDeviceCapabilities 13 | 14 | arm64 15 | 16 | UISupportedInterfaceOrientations 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationLandscapeLeft 20 | UIInterfaceOrientationLandscapeRight 21 | 22 | UISupportedInterfaceOrientations~ipad 23 | 24 | UIInterfaceOrientationPortrait 25 | UIInterfaceOrientationPortraitUpsideDown 26 | UIInterfaceOrientationLandscapeLeft 27 | UIInterfaceOrientationLandscapeRight 28 | 29 | XSAppIconAssets 30 | Assets.xcassets/appicon.appiconset 31 | 32 | 33 | -------------------------------------------------------------------------------- /SQLiteDemo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31611.283 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLiteDemo", "SQLiteDemo.csproj", "{93DACE04-044B-465B-9053-44CE20BC2CB6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 17 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {93DACE04-044B-465B-9053-44CE20BC2CB6}.Release|Any CPU.Deploy.0 = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /SearchHandlers/StudentSearchHandler.cs: -------------------------------------------------------------------------------- 1 | using SQLiteDemo.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SQLiteDemo.SearchHandlers 9 | { 10 | public class StudentSearchHandler : SearchHandler 11 | { 12 | public IList Students { get; set; } 13 | public string NavigationRoute { get; set; } 14 | public Type NavigationType { get; set; } 15 | protected override void OnQueryChanged(string oldValue, string newValue) 16 | { 17 | base.OnQueryChanged(oldValue, newValue); 18 | 19 | if (string.IsNullOrWhiteSpace(newValue)) 20 | { 21 | ItemsSource = null; 22 | } 23 | else 24 | { 25 | ItemsSource = Students.Where(student => student.FullName.ToLower().Contains(newValue.ToLower())).ToList(); 26 | } 27 | } 28 | 29 | protected override async void OnItemSelected(object item) 30 | { 31 | base.OnItemSelected(item); 32 | var navParam = new Dictionary(); 33 | navParam.Add("StudentDetail", item); 34 | if (!string.IsNullOrWhiteSpace(NavigationRoute)) 35 | { 36 | await Shell.Current.GoToAsync(NavigationRoute, navParam); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 12 | 17 | 18 |