public void GetJournalsByCropId(Action<List<JournalModel>> callback, int cropId) { ViewGetJournalsByCropId = callback; JournalRepository journalRepository = new JournalRepository(); GetJournalsByCropIdCallback handler = new GetJournalsByCropIdCallback(GetJournalByCropIdCompleted); journalRepository.GetJournalsByCropId(new Action<List<JournalModel>>(handler), cropId); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string cropIdValue = NavigationContext.QueryString["parameter"]; cropId = Int16.Parse(cropIdValue); JournalRepository journalRep = new JournalRepository(); GetJournalsByCropIdCallback handler = new GetJournalsByCropIdCallback(GetJournalsByCropIdCompleted); journalRep.GetJournalsByCropId(new Action<List<JournalModel>>(handler), cropId); }
public void SaveJournal(Action<int> callback, JournalModel journalModel) { ViewSaveCallback = callback; JournalRepository journalRepository = new JournalRepository(); SaveJournalCallback handler = new SaveJournalCallback(SaveJournalCompleted); journalRepository.SaveJournal(new Action<int>(handler), journalModel); }