当前位置: 首页>>代码示例>>C#>>正文


C# BindableCollection.Single方法代码示例

本文整理汇总了C#中BindableCollection.Single方法的典型用法代码示例。如果您正苦于以下问题:C# BindableCollection.Single方法的具体用法?C# BindableCollection.Single怎么用?C# BindableCollection.Single使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindableCollection的用法示例。


在下文中一共展示了BindableCollection.Single方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: initializePivotRunTimeCalculatorViewModel

        private void initializePivotRunTimeCalculatorViewModel()
        {
            Hours = new BindableCollection<TimeViewModel>().CreateHours();
            Minutes = new BindableCollection<TimeViewModel>().CreateMinutes();
            Seconds = new BindableCollection<TimeViewModel>().CreateSeconds();
            Kilometers = new BindableCollection<DistanceViewModel>().CreateKilometers();
            Meters = new BindableCollection<DistanceViewModel>().CreateMeters();
            Centimeters = new BindableCollection<DistanceViewModel>().CreateCentimeters();

            SelectedKilometer = Kilometers.Single(s => s.Title == 0);
            SelectedMeter = Meters.Single(s => s.Title == 0);
            SelectedCentimeter = Centimeters.Single(s => s.Title == 0);
            SelectedHour = Hours.Single(s => s.Title == 0);
            SelectedMinute = Minutes.Single(s => s.Title == 0);
            SelectedSecond = Seconds.Single(s => s.Title == 0);
        }
开发者ID:benediktfunk,项目名称:RunTimeCalc,代码行数:16,代码来源:PivotRunTimeCalculatorViewModel.cs

示例2: LoadDayScheduleInternal

        private void LoadDayScheduleInternal()
        {
            DaySchedule = new BindableCollection<ScheduleViewModel>();
            for (var i = 0; i < 24; i++)
            {
                if (i < 10)
                {
                    var hourFormat = string.Format("0{0}", i);
                    this.DaySchedule.Add(new ScheduleViewModel { Hour = hourFormat });
                }
                else
                    this.DaySchedule.Add(new ScheduleViewModel { Hour = i.ToString(CultureInfo.InvariantCulture) });
            }

            foreach (var appointment in appointmentService.GetAllByStartDate(this.StartTimeViewModel.DateTime))
                DaySchedule.Single(c => Convert.ToInt32(c.Hour) == appointment.StartDate.Hour).Appointment = appointment;
            Dispatcher.CurrentDispatcher.Invoke(new Action(() => IsDayScheduleLoading = false));
        }
开发者ID:schultyy,项目名称:octocal,代码行数:18,代码来源:EventEditorViewModel.cs


注:本文中的BindableCollection.Single方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。