public Location GetLocationByShout(DragonShout shout) { using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation)) { return(conn.Table <Location>().Where(x => shout.WordWallLocation.Contains(x.LocationName)).FirstOrDefault()); } }
private void CheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e) { var ss = new ShoutService(); var shoutChecked = (CheckBox)sender; DragonShout shout = shoutChecked.BindingContext as DragonShout; ss.UpdateShoutCheck(shoutChecked.IsChecked, shout); }
public void UpdateShoutCheck(bool check, DragonShout shout) { using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation)) { var result = conn.Table <DragonShout>().Where(x => x.ID == shout.ID).FirstOrDefault(); result.Check = check; conn.Update(result); } }
public ShoutPage(DragonShout shout) { Shout = shout; InitializeComponent(); var ss = new ShoutService(); ShoutLocation = ss.GetLocationByShout(Shout); this.BindingContext = new ShoutViewModel(Shout); }
public ShoutViewModel(DragonShout shout) { Shout = shout; var ss = new ShoutService(); ShoutLocation = ss.GetLocationByShout(Shout); if (ShoutLocation == null) { return; } HasLocationlink = true; }