コード例 #1
0
        public override void OnReceive(Context context, Intent intent)
        {
            // We don't need to do any async code, since notifying the widget manager
            // automatically creates a service that will do the async work, so there's no
            // need to create a service just for receiving this alarm.

            // Updating the widget does the following...
            // (1) Updates the widget
            // (2) Schedules the next alarm that will call this again in the future to update again
            WidgetsHelper.UpdateAgendaWidget();
        }
コード例 #2
0
        private async void UpdateSettings()
        {
            try
            {
                if (ViewModel.Account == null)
                {
                    return;
                }

                ViewModel.Account.MainTileSettings.ShowHomework       = _switchTasks.Checked;
                ViewModel.Account.MainTileSettings.ShowExams          = _switchEvents.Checked;
                ViewModel.Account.MainTileSettings.SkipItemsOlderThan = GetSkipNumber();

                await AccountsManager.Save(ViewModel.Account);

                WidgetsHelper.UpdateAgendaWidget();
            }
            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }
        }