-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
29 lines (26 loc) · 929 Bytes
/
App.xaml.cs
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
using JournalApp.Models;
using System.Collections.ObjectModel;
namespace JournalApp
{
public partial class App : Application
{
public static ObservableCollection<JournalEntry> JournalEntries { get; private set; } = new();
public App()
{
InitializeComponent();
//Brainydaps Editing
JournalEntries = new ObservableCollection<JournalEntry>();
MainPage = new NavigationPage(new MainPage());
}
public static void AddJournalEntry(JournalEntry entry)
{
JournalEntries.Add(entry);
// Check if the AddJournalEntry method is being called correctly
System.Diagnostics.Debug.WriteLine("JournalEntry added");
if (Current.MainPage?.BindingContext is MainPageViewModel mainPageViewModel)
{
mainPageViewModel.RefreshEntries();
}
}
}
}