internal SharedLayoutRegion GetNextRegion(SharedLayoutRegion region)
        {
            var idx = Regions.IndexOf(region);

            if (idx + 1 < Regions.Count)
            {
                return(Regions[idx + 1]);
            }
            return(null);
        }
        internal SharedLayoutRegion GetPreviousRegion(SharedLayoutRegion region)
        {
            var idx = Regions.IndexOf(region);

            if (idx > 0)
            {
                return(Regions[idx - 1]);
            }
            return(null);
        }
 public SharedLayoutRegion this[int index]
 {
     get
     {
         var slr = new SharedLayoutRegion(this, index);
         for (int i = 0; i < Regions.Count; i++)
         {
             if (Regions[i].Index > index)
             {
                 Regions.Insert(i, slr);
                 return(slr);
             }
         }
         Regions.Add(slr);
         return(slr);
     }
 }
 public IEnumerable <SharedLayoutRegion> GetPreceedingRegions(SharedLayoutRegion region)
 {
     return(Regions.Where(r => r.Index < region.Index));
 }
 public static void SetRegion(DependencyObject obj, SharedLayoutRegion value)
 {
     obj.SetValue(RegionProperty, value);
 }