private void initICommands() { DeleteCommand = new Command( execute: (item) => { RealmFunctions.DeleteItem(_realm, (RealmObject)item); }, canExecute: (item) => true ); AddCommand = new Command( execute: () => { Singleton store = Singleton.Instance; store.CURRENT_SMOOTHIE_ID = null; Application.Current.MainPage.Navigation.PushAsync(new EditSmoothieItemPage()); }, canExecute: () => true ); }
private async Task Initialize() { _realm = await RealmFunctions.OpenRealm(); Smoothies = _realm.All <Smoothie>().OrderBy(m => m.Name); }