Download Logo

Entry without underline

Create Custom Entry Control 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 namespace WaterReminder.CFDControl; public class CfdEntry :Entry { protected override void OnHandlerChanged() { base.OnHandlerChanged(); SetBorderlessBackground(); } protected override void OnPropertyChanged([CallerMemberName] string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == nameof(BackgroundColor)) { SetBorderlessBackground(); } } private void SetBorderlessBackground() { #if ANDROID if (Handler is IEntryHandler entryHandler) { if (BackgroundColor == null) { entryHandler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToPlatform()); } else { entryHandler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(BackgroundColor.ToPlatform()); } } #endif } } Step uses Import Name Spaces. in Xaml and so on … ...

June 19, 2025 · 2 min · 253 words · PrashantUnity
Download Logo

SQLite in MAUI

Implementation Steps Install/ Add Microsoft.EntityFrameworkCore.Sqlite to Project 1 <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.7" /> Register App db Context before var app = builder.Build(); in MauiProgram.cs 1 2 3 var dbPath = Path.Combine(FileSystem.AppDataDirectory, "waterreminder.db3"); builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlite($"Filename={dbPath}")); Just Before app run add this Command 1 2 3 4 5 6 7 8 // Initialize the database using (var scope = app.Services.CreateScope()) { var dbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>(); dbContext.Database.EnsureCreated(); } return app; Create Add Db Context 1 2 3 4 5 6 namespace WaterReminder.Data; public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options) { public DbSet<Reminder> Reminders { get; set; } } Below is service or uses 1 2 3 4 5 6 7 8 9 10 11 public class ReminderService : IReminderService { private readonly AppDbContext _context; public ReminderService(AppDbContext context) { _context = context; } public Task<List<Reminder>> GetRemindersAsync() => _context.Reminders.ToListAsync(); }

June 19, 2025 · 1 min · 134 words · PrashantUnity