-
Notifications
You must be signed in to change notification settings - Fork 0
Real Time Chart updates using Firebase Server #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d75abfb
c9fb3fb
480958a
af06c8b
6cfbe13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,24 @@ | ||
| using KPIDashboard; | ||
| using Microsoft.Extensions.Logging; | ||
|
|
||
| namespace KPIDashboard.DashboardPages | ||
| { | ||
| public partial class MainPageMobile : ContentPage | ||
| { | ||
| public MainPageMobile() | ||
| { | ||
| InitializeComponent(); | ||
|
|
||
| BindingContext = MauiProgram.Services! | ||
| .GetRequiredService<KPIDashboard.DashboardViewModel>(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this unwanted space @KompelliSravanSyncfusion |
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,12 @@ namespace KPIDashboard | |
| { | ||
| public static class MauiProgram | ||
| { | ||
| public static IServiceProvider? Services { get; private set; } | ||
|
|
||
| public static MauiApp CreateMauiApp() | ||
| { | ||
| var builder = MauiApp.CreateBuilder(); | ||
|
|
||
| builder | ||
| .UseMauiApp<App>() | ||
| .ConfigureSyncfusionToolkit() | ||
|
|
@@ -17,11 +20,23 @@ public static MauiApp CreateMauiApp() | |
| fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | ||
| }); | ||
|
|
||
| // Register services | ||
| builder.Services.AddSingleton<FirebaseService>(); | ||
| builder.Services.AddSingleton<DashboardViewModel>(sp => | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. avoid sp, and db use proper naming. |
||
| { | ||
| var db = sp.GetRequiredService<FirebaseService>(); | ||
| var logger = sp.GetService<ILogger<DashboardViewModel>>(); | ||
| return new DashboardViewModel(db, logger); | ||
| }); | ||
|
|
||
| #if DEBUG | ||
| builder.Logging.AddDebug(); | ||
| builder.Logging.AddDebug(); | ||
| #endif | ||
|
|
||
| return builder.Build(); | ||
| var app = builder.Build(); | ||
| Services = app.Services; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the real purpose? |
||
| return app; | ||
| } | ||
| } | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove unwanted spaces. |
||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use null checks avoid null forgiving operator '!'.