示例#1
0
        internal void SetBadge(BadgeValue value)
        {
            badgeValueControl.Value = value;

            // This might have affected branding height, so notification needs to re-display to adjust for the available size
            Reshow();
        }
        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            if (value is string)
            {
                return(BadgeValue.Parse(value as string));
            }

            return(BadgeValue.Parse(null));
        }
示例#3
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            BadgeValue badgeValue = value as BadgeValue;

            if (badgeValue == null)
            {
                return(Visibility.Collapsed);
            }

            if (badgeValue.HasBadge())
            {
                return(Visibility.Visible);
            }

            return(Visibility.Collapsed);
        }
示例#4
0
        /// <summary>
        /// Applies a change to the badge's glyph or number.
        /// </summary>
        /// <param name="badgeNotification"></param>
        public void Update(BadgeNotification badgeNotification)
        {
            if (badgeNotification.Content == null)
            {
                throw new NullReferenceException("badgeNotification.Content must be provided.");
            }

            IXmlNode badgeNode = badgeNotification.Content.SelectSingleNode("/badge");

            if (badgeNode == null)
            {
                throw new NullReferenceException("<badge> element must be provided in the xml");
            }

            var valueAttribute = badgeNode.Attributes.GetNamedItem("value");

            if (valueAttribute == null)
            {
                throw new NullReferenceException("<badge> element must have a \"value\" attribute specified.");
            }

            _previewTile.SetBadge(BadgeValue.Parse(valueAttribute.InnerText));
        }
示例#5
0
 /// <summary>
 /// Removes the badge from the tile that the updater is bound to.
 /// </summary>
 public void Clear()
 {
     _previewTile.SetBadge(BadgeValue.Default());
 }
 public static void Set(BadgeValue badgeValue, User user)
 {
 }
 public static void Set(BadgeValue badgeValue)
 {
 }