示例#1
0
        protected async override void OnLaunched(LaunchActivatedEventArgs e)
        {
            List <Ship> schiffe = new List <Ship>();

            try { schiffe = await Schiffspeicher.File <List <Ship> >("alle").Read(); }
            catch (Exception) { await Schiffspeicher.DeleteAll(); }


            Prototype = Show.Prototype(With.These(await Squadronspeicher.All(), schiffe, Dice.Alle(), await Einstellungen.Alle())
                                       .AndViewOf <Squadron>()
                                       .AndViewOf <Pilot>()
                                       .AndViewOf <Ship>()
                                       .AndViewOf <Dice>()
                                       .AndViewOf <Einstellungen>()
                                       .AndOpen <Squadron>());



            var isStatusBarPresent = ApiInformation.IsTypePresent(typeof(StatusBar).ToString());

            if (isStatusBarPresent)
            {
                var statusBar = StatusBar.GetForCurrentView();
                statusBar.BackgroundColor = Colors.White;
                statusBar.ForegroundColor = Colors.Black;
            }
        }
示例#2
0
        private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            var ships = Prototype.Repository.OfType <Ship>().ToList();

            Schiffspeicher.File <List <Ship> >("alle").SaveOrUpdateSync(ships);
        }