Example #1
0
        internal Element_ToastBinding ConvertToElement()
        {
            Element_ToastBinding binding = new(ToastTemplateType.ToastGeneric)
            {
                BaseUri       = BaseUri,
                AddImageQuery = AddImageQuery,
                Language      = Language
            };

            // Add children
            foreach (var child in Children)
            {
                var el = (IElement_ToastBindingChild)AdaptiveHelper.ConvertToElement(child);
                binding.Children.Add(el);
            }

            // Add attribution
            if (Attribution != null)
            {
                binding.Children.Add(Attribution.ConvertToElement());
            }

            // If there's hero, add it
            if (HeroImage != null)
            {
                binding.Children.Add(HeroImage.ConvertToElement());
            }

            // If there's app logo, add it
            if (AppLogoOverride != null)
            {
                binding.Children.Add(AppLogoOverride.ConvertToElement());
            }

            return(binding);
        }
    }
Example #2
0
 private static IElement_TileBindingChild ConvertToBindingChildElement(ITileBindingContentAdaptiveChild child)
 {
     return((IElement_TileBindingChild)AdaptiveHelper.ConvertToElement(child));
 }