Element_AdaptiveGroup.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // ******************************************************************
  2. // Copyright (c) Microsoft. All rights reserved.
  3. // This code is licensed under the MIT License (MIT).
  4. // THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  5. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  7. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  8. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  9. // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
  10. // THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
  11. // ******************************************************************
  12. using System.Collections.Generic;
  13. namespace Microsoft.Toolkit.Uwp.Notifications.Adaptive.Elements
  14. {
  15. [NotificationXmlElement("group")]
  16. internal sealed class Element_AdaptiveGroup : IElement_TileBindingChild, IElement_ToastBindingChild, IElementWithDescendants
  17. {
  18. public IList<Element_AdaptiveSubgroup> Children { get; private set; } = new List<Element_AdaptiveSubgroup>();
  19. public IEnumerable<object> Descendants()
  20. {
  21. foreach (Element_AdaptiveSubgroup subgroup in Children)
  22. {
  23. // Return the subgroup
  24. yield return subgroup;
  25. // And also return its descendants
  26. foreach (object descendant in subgroup.Descendants())
  27. {
  28. yield return descendant;
  29. }
  30. }
  31. }
  32. }
  33. }