public async Task <bool> UpdateTabataAsync(Tabata item) { var oldTabata = items.Where((Tabata arg) => arg.ID == item.ID).FirstOrDefault(); items.Remove(oldTabata); items.Add(item); return(await Task.FromResult(true)); }
public EditTabataView(Tabata tabata) { CurrentTabata = tabata.Clone(); TemporaryLength = CurrentTabata.CompleteLength; CurrentTabata.PropertyChanged += CurrentTabata_PropertyChanged; BindingContext = CurrentTabata; InitializeComponent(); }
public PlayingTabataView(Tabata attached) { BindingContext = this; playingState = new CurrentPlayingViewModel(attached); playingState.PropertyChanged += onTabataPropertyChanged; InitializeComponent(); Sync(); }
private void UpdateParentTabata(Element parent) { Type myType = parent.GetType(); IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties()); foreach (PropertyInfo prop in props) { if (prop.PropertyType == typeof(Tabata)) { Tabata tabata = prop.GetValue(parent, null) as Tabata; if (tabata != null) { tabata.UpdateDuration(); } } } if (parent.Parent != null) { UpdateParentTabata(parent.Parent); } }
public async Task <bool> AddTabataAsync(Tabata item) { items.Add(item); return(await Task.FromResult(true)); }