private void DecoUpdate() { if (!Sauvegarde.IsConnected()) { ToolbarItems.Remove(ButtonDeco); } else if (!ToolbarItems.Contains(ButtonDeco)) { ToolbarItems.Add(ButtonDeco); } }
protected async override void OnAppearing() { base.OnAppearing(); Equipe = KTContext.Db.Teams .Where(e => e.Id == equipeId) .Include(e => e.Members) .ThenInclude(m => m.Specialist) .Include(e => e.Members) .ThenInclude(m => m.ModelProfile.Model.ModelWeapons) .ThenInclude(fa => fa.Weapon) .Include(e => e.Members) .ThenInclude(m => m.ModelProfile.ModelProfileWeapons) .ThenInclude(da => da.Weapon) .Include(e => e.Members) .ThenInclude(m => m.MemberWeapons) .ThenInclude(m => m.Weapon) .ThenInclude(a => a.WeaponProfiles) .ThenInclude(a => a.WeaponType) .Include(e => e.Members) .ThenInclude(m => m.MemberWarGearOptions) .ThenInclude(mr => mr.WarGearOption) .Include(e => e.Faction) .First(); Equipe.Members = Equipe.Members.OrderBy(o => o.Name).ToList(); BindingContext = Equipe; ErreursUpdate(); if (Sauvegarde.IsConnected()) { if (await Sauvegarde.Synchro(KTContext.Db)) { Equipe = KTContext.Db.Teams .Where(e => e.Id == equipeId) .Include(e => e.Members) .ThenInclude(m => m.Specialist) .Include(e => e.Members) .ThenInclude(m => m.ModelProfile) .Include(e => e.Members) .ThenInclude(m => m.MemberWarGearOptions) .ThenInclude(mr => mr.WarGearOption) .Include(e => e.Faction).First(); Equipe.Members = Equipe.Members.OrderBy(o => o.Name).ToList(); BindingContext = Equipe; } } }
public async Task Refresh() { if (Device.RuntimePlatform != Device.Android) { ToolbarItems.Remove(ButtonDeco); ToolbarItems.Remove(ButtonSync); await UpdateListItems(); return; } if (Sauvegarde.IsConnected() && await Sauvegarde.Synchro(KTContext.Db)) { await UpdateListItems(); } DecoUpdate(); await UpdateListItems(); }
protected async override void OnAppearing() { base.OnAppearing(); Member membre = KTContext.Db.Members.Where(m => m.Id == membreId) .Include(m => m.ModelProfile) .Include(m => m.Specialist.Powers) .Include(m => m.MemberWeapons) .ThenInclude(a => a.Weapon) .ThenInclude(a => a.WeaponProfiles) .ThenInclude(pa => pa.WeaponType).First(); FillArmGrid(ArmeGrid, membre); BindingContext = membre; if (Sauvegarde.IsConnected()) { await Sauvegarde.Synchro(KTContext.Db); } }