Ejemplo n.º 1
0
 private void OnModuleLookupSelected(object sender, ModulesLookup e)
 {
     if (e != null)
     {
         Task.Run(async() => await CurrentUserUtil.UpdateCurrentUserConfigAsync(e.ModuleId, e.ModuleLookupId));
     }
 }
Ejemplo n.º 2
0
        private void OnTopicsLoaded(object sender, EventArgs e)
        {
            Task.Run(async() =>
            {
                using (var db = new DbUtil())
                {
                    var config = await CurrentUserUtil.GetCurrentUserConfigurationAsync();
                    ModulesLookup moduleLookup = null;
                    if (config != null && config.CurrentTopicId != null && (Topics?.Any(i => i.ModuleLookupId == config.CurrentTopicId) ?? false))
                    {
                        moduleLookup = await db.AsyncConnection.FindAsync <ModulesLookup>(i => i.ModuleLookupId == config.CurrentTopicId);
                    }
                    else
                    {
                        moduleLookup = Topics?.Where(i => i.Date.HasValue && i.Date.Value.Date == DateTime.Now.Date).FirstOrDefault() ?? Topics?.FirstOrDefault();
                    }

                    if (moduleLookup != null)
                    {
                        await db.AsyncConnection.GetChildrenAsync(moduleLookup, recursive: true);
                    }
                    SelectedModulesLookup = moduleLookup;
                }
            });
        }
Ejemplo n.º 3
0
 public PrayerHomeVM(ModulesLookup moduleLookup)
 {
     Topics = new ObservableCollection <ModulesLookup>();
     SetSearchCommand();
     SelectedModulesLookup  = moduleLookup;
     TopicsLoaded          += OnTopicsLoaded;
     ModulesLookupSelected += OnModuleLookupSelected;
 }