예제 #1
0
        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));
        }
예제 #2
0
        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();
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public async Task <bool> AddTabataAsync(Tabata item)
 {
     items.Add(item);
     return(await Task.FromResult(true));
 }