本文整理汇总了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);
}
示例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));
}