public void CheckAndFixRegionValues(int index) { var imageItems = Images.Cast <ImageItem>().ToList(); var regions = CollectionViewSource.GetDefaultView(imageItems[index].Regions).Cast <RegionObject>(); foreach (var regionPosition in regions) { regionPosition.CheckAndFixRegionValues(); } }
public void RefreshRegions(int index) { if (index == -1) { CurrentItemRegions = null; } else { var imageItems = Images.Cast <ImageItem>().ToList(); CurrentItemRegions = CollectionViewSource.GetDefaultView(imageItems[index].Regions); _lastIndex = index; } }
public bool IsRegAny() { if (_lastIndex != -1 && Images != null) { var imageItems = Images.Cast <ImageItem>().ToArray(); if (!imageItems.Any()) { return(false); } return(imageItems[_lastIndex].Regions.Any()); } return(false); }
public IEnumerator<object> GetEnumerator() { return Images.Cast<object>().GetEnumerator(); }