Source: http://www.bcmeng.com/lockscreen/
Before the small dream and everyone to share the toast Notice, magnet update, today small dream and everyone share the Windows Phone 8.1 development in the lock screen reminder. The badge is simple compared to toast notifications and magnet updates. There are two types of badge: a digital reminder and a glyph alert, in Windows In Phone 8.1, the phone badge only supports the "alert" and "note" status glyphs and numbers. Sending any other glyphs to your phone clears the badge. The supported glyphs are as follows:
Status |
Glyph |
XML |
No |
No badge is displayed |
<badge value="none"/> |
Alerts |
|
<badge value="alert"/> |
Attention |
|
<badge value="attention"/> |
Select a reminder type:
Select number:
XmlDocument badgexml = badgeupdatemanager.gettemplatecontent (Badgetemplatetype.badgenumber);
Select a glyph:
XmlDocument badgexml = badgeupdatemanager.gettemplatecontent (badgetemplatetype.badgeglyph);
Set the value for a number or glyph:
Set the value of the number: ( Note: If the number is greater than 99, the 99+ is displayed)
XmlElement badgeelement = (XmlElement) badgexml.selectsinglenode ("/badge"); Badgeelement.setattribute ("value""n");
Set the value of the glyph:
Badgeelement.setattribute ("value""alert"); Badgeelement.setattribute ("value""attention") ;
Create a badge alert and send it to a badge:
New badgenotification (badgexml); Badgeupdatemanager.createbadgeupdaterforapplication (). Update (badge);
The effect is as follows:
So how to display the badge update on the lock screen:
Very simply, first in the app manifest file in the app 's lock screen notification select Badge and figure this article block .
Then upload a 24*24 png image in the badge of the visible asset , preferably transparent. The badge is then displayed on the lock screen. The effect is as follows:
Windows Phone 8.1 Development in the toast notification, magnet Update, lock screen Reminder small dreams are shared with you, and in the actual application of these updates are generally in the background tasks updated, and then combined with the background task explained before, I believe everyone will be!
Windows Phone 8.1 Development: Lock Screen Reminders