示例#1
0
        private void MatchTime(string totalEventMinutesAndSeconds, int?statusID)
        {
            _statusID = (int)statusID;
            string matchTime = new LiveMatchTimeConverter()?.Convert(totalEventMinutesAndSeconds, null, statusID, CultureInfo.CurrentCulture)?.ToString();

            MatchTimeLabel.Text = matchTime;
        }
        private void PopulateMatchTime()
        {
            Match  selectedMatch = MatchTimeLabel.BindingContext as Match;
            string totalEventMinutesAndSeconds = new TotalTimeFromSelectedMatchTimeConverter()?.Convert(selectedMatch, null, null, CultureInfo.CurrentCulture)?.ToString();
            string fullMatchTime = new LiveMatchTimeConverter()?.Convert(totalEventMinutesAndSeconds, null, selectedMatch?.StatusID, CultureInfo.CurrentCulture)?.ToString();

            MatchTimeLabel.Text = fullMatchTime;
        }
        private void MatchTimeLayout_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            StackLayout matchTimeLayout = sender as StackLayout;
            Label       matchTimeLabel  = matchTimeLayout.Children?.FirstOrDefault() as Label;

            Device.StartTimer(new TimeSpan(0, 0, 1), () =>
            {
                Match selectedMatch = matchTimeLabel.BindingContext as Match;
                string totalEventMinutesAndSeconds = new TotalTimeFromSelectedMatchTimeConverter()?.Convert(selectedMatch, null, null, CultureInfo.CurrentCulture)?.ToString();
                string fullMatchTime = new LiveMatchTimeConverter()?.Convert(totalEventMinutesAndSeconds, null, selectedMatch?.StatusID, CultureInfo.CurrentCulture)?.ToString();
                matchTimeLabel.Text  = fullMatchTime;
                return(true);
            });
        }
示例#4
0
        private void TimeLabelPopulate(string totalEventMinutesAndSeconds, int?statusID)
        {
            string fullMatchTime = new LiveMatchTimeConverter()?.Convert(totalEventMinutesAndSeconds, null, statusID, CultureInfo.CurrentCulture)?.ToString();

            MatchTimeLabel.Text = fullMatchTime;
            if (fullMatchTime.Contains(":"))
            {
                string[] timeTextArray = fullMatchTime.Split(':') ?? new string[2];
                MinutesLabel.Text = timeTextArray[0];
                SecondsLabel.Text = timeTextArray[1];
            }
            else
            {
                MinutesLabel.Text = "";
                SecondsLabel.Text = "";
            }
        }