static public void Register(string dataPath) { _mainDB = new BsonData.DataBase(dataPath, "MainDB"); // Create Admin account if not exists var acc = new Controllers.AccountController(); acc.InsertAccount(new Models.Account { Id = "admin", Role = Roles.Admin }); }
public static void Init(Application app) { Register(app, result => { var view = result.View; var page = (Page)((System.Mvc.IRenderer)view).GetResult(); if (page == null) { return; } if (page != null) { if (page is IRootPage) { ((IDisposable)app.MainPage).Dispose(); app.MainPage = page; } else if (page is MyNavigationItemPage) { var np = (MyNavigationItemPage)page; var root = (MyNavigationPage)app.MainPage; root.Back(np.Back); root.PushAsync(page); } } }); StyleSheetMap.SetClass <MyButton>(new StyleSheet { Background = "008cfd", Foreground = "E5F5E7", BorderSize = 4, CornerRadius = 8, }); _mainDb = new BsonData.DataBase(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Data"); Execute("home"); }