本文整理汇总了C#中ObservableCollection.IsNotNullOrEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableCollection.IsNotNullOrEmpty方法的具体用法?C# ObservableCollection.IsNotNullOrEmpty怎么用?C# ObservableCollection.IsNotNullOrEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableCollection
的用法示例。
在下文中一共展示了ObservableCollection.IsNotNullOrEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InstructionZonesViewModel
public InstructionZonesViewModel(List<Guid> instructionZonesList, ZoneType zoneType)
{
AddOneCommand = new RelayCommand(OnAddOne, CanAddOne);
RemoveOneCommand = new RelayCommand(OnRemoveOne, CanRemoveOne);
AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
Title = "Выбор зоны";
InstructionZonesList = new List<Guid>(instructionZonesList);
InstructionZones = new ObservableCollection<ZoneViewModel>();
AvailableZones = new ObservableCollection<ZoneViewModel>();
InitializeZones(zoneType);
if (InstructionZones.IsNotNullOrEmpty())
SelectedInstructionZone = InstructionZones[0];
}
示例2: ZoneSelectionViewModel
public ZoneSelectionViewModel(List<Guid> zonesList)
{
AddOneCommand = new RelayCommand(OnAddOne, CanAddOne);
RemoveOneCommand = new RelayCommand(OnRemoveOne, CanRemoveOne);
AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
Title = "Выбор зоны";
ChosenZonesList = new List<Guid>(zonesList);
ChosenZones = new ObservableCollection<ZoneViewModel>();
AvailableZones = new ObservableCollection<ZoneViewModel>();
InitializeZones();
if (ChosenZones.IsNotNullOrEmpty())
SelectedChosenZone = ChosenZones[0];
}
示例3: Initialize
public void Initialize()
{
DrawAllPlans();
Plans = new ObservableCollection<PlanViewModel>();
BuildTree();
if (Plans.IsNotNullOrEmpty())
SelectedPlan = Plans[0];
}
示例4: Initialize
public void Initialize()
{
IsNowPlaying = false;
Sounds = new ObservableCollection<SoundViewModel>();
foreach (StateType stateType in Enum.GetValues(typeof(StateType)))
{
if (stateType == StateType.No)
{
continue;
}
var newSound = new Sound() { StateType = stateType };
if (FiresecClient.FiresecManager.SystemConfiguration.Sounds.IsNotNullOrEmpty())
{
var sound = FiresecClient.FiresecManager.SystemConfiguration.Sounds.FirstOrDefault(x => x.StateType == stateType);
if (sound == null)
FiresecClient.FiresecManager.SystemConfiguration.Sounds.Add(newSound);
else
newSound = sound;
}
else
{
FiresecClient.FiresecManager.SystemConfiguration.Sounds.Add(newSound);
}
Sounds.Add(new SoundViewModel(newSound));
}
if (Sounds.IsNotNullOrEmpty())
SelectedSound = Sounds[0];
}