private static bool GetContentAnchorableIsHidden(LayoutAnchorable anchorable)
 {
     if (anchorable == null)
     {
         return false;
     }
     if (anchorable.IsAnchorable())
     {
         return anchorable.GetAnchorableIsHidden();
     }
     else if (anchorable.Content.IsAnchorable())
     {
         return anchorable.Content.GetAnchorableIsHidden();
     }
     else
     {
         throw new InvalidOperationException();
     }
 }
        private static AnchorableShowStrategy GetContentAnchorableStrategy(LayoutAnchorable anchorable)
        {
            var anchorableStrategy = AnchorableStrategy.Most;
            if (anchorable != null)
            {
                if (anchorable.IsAnchorable())
                {
                    anchorableStrategy = anchorable.GetAnchorableStrategy();
                }
                else if (anchorable.Content.IsAnchorable())
                {
                    anchorableStrategy = anchorable.Content.GetAnchorableStrategy();
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }

            AnchorableShowStrategy flag = 0;
            foreach (AnchorableStrategy strategyFlag in SplitAnchorableStrategies(anchorableStrategy))
            {
                var strategy = AnchorableShowStrategy.Most;
                strategyFlag.ValueSwitchOn()
                   .Case(AnchorableStrategy.Most,
                         x => strategy = AnchorableShowStrategy.Most)
                   .Case(AnchorableStrategy.Left,
                         x => strategy = AnchorableShowStrategy.Left)
                   .Case(AnchorableStrategy.Right,
                         x => strategy = AnchorableShowStrategy.Right)
                   .Case(AnchorableStrategy.Top,
                         x => strategy = AnchorableShowStrategy.Top)
                   .Case(AnchorableStrategy.Bottom,
                         x => strategy = AnchorableShowStrategy.Bottom)
                   .Default(x =>
                   {
                       throw new InvalidEnumArgumentException("Unknown AnchorableStrategy value");
                   });
                flag |= strategy;
            }
            if (flag == 0)
            {
                flag = AnchorableShowStrategy.Most;
            }
            return flag;
        }