Example #1
0
        /// <summary>
        /// The user moved current datetime on one of the timeline bands, so we
        /// sync all other bands with it.</summary>
        private void OnCurrentDateChanged(object sender, RoutedEventArgs e)
        {
            TimelineBand band;

            if (!m_changingDate)
            {
                try
                {
                    m_changingDate = true;

                    band = (TimelineBand)sender;
                    m_currentDateTime = band.CurrentDateTime;

                    m_bands.ForEach(b =>
                    {
                        if (sender != b)
                        {
                            b.CurrentDateTime = band.CurrentDateTime;
                        }
                    });

                    CurrentDateChanged?.Invoke(this, EventArgs.Empty);
                }
                finally
                {
                    m_changingDate = false;
                }
            }
        }
Example #2
0
        private void DayPagerControl_PageSelected(object sender, PageSelectedEventArgs e)
        {
            try
            {
                if (ItemsSource != null && Adapter != null)
                {
                    var adapter = this.Adapter as DayPagerAdapter;

                    DateTime date = adapter.GetDate(e.Position);

                    try
                    {
                        CurrentDateChanged?.Invoke(this, date);
                    }

                    catch { }
                }
            }

            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }
        }