public static void createTileUpdate(CoverEvents coverEvent, string url) { string eventTitle = coverEvent.title; string eventDate = coverEvent.date.ToShortDateString(); string eventDays = coverEvent.days.Days.ToString(); string eventCheck = coverEvent.check; string imageUrl = url; string content = $@" <tile> <visual branding='nameAndLogo'> <binding template='TileMedium' displayName='{eventDate}' hint-lockDetailedStatus1='Meeting with Thomas' hint-lockDetailedStatus2='11:00 AM - 12:30 PM' hint-lockDetailedStatus3='Studio F'> <image src='{imageUrl}' placement='background' hint-overlay='30'/> <text hint-style='title' hint-align='center'>{eventDays}</text> <text hint-style='caption' hint-wrap='true' hint-align='center' hint-maxLines='2'>{eventTitle}</text> </binding> <binding template='TileWide' displayName='{eventDate}' hint-lockDetailedStatus1='Meeting with Thomas' hint-lockDetailedStatus2='11:00 AM - 12:30 PM' hint-lockDetailedStatus3='Studio F'> <image src='{imageUrl}' placement='background' hint-overlay='30'/> <group> <subgroup hint-weight='5'> <text hint-style='subheader' hint-align='center'>{eventDays}</text> <text hint-style='body' hint-align='center'>{eventCheck}</text> </subgroup> <subgroup hint-weight='6' hint-textStacking='center'> <text hint-style='body' hint-wrap='true' hint-align='center'>{eventTitle}</text> </subgroup> </group> </binding> <binding template='TileLarge'> <image src='{imageUrl}' placement='background' hint-overlay='30'/> <text hint-style='header' hint-align='center'>{eventDays}</text> <text hint-style='subtitle' hint-align='center'>{eventDate}</text> <text hint-style='body' hint-align='center'>{eventCheck}</text> <text hint-style='subtitle' hint-wrap='true' hint-align='center' hint-maxLines='2'>{eventTitle}</text> </binding> </visual> </tile>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(content); TileNotification tileNotification = new TileNotification(doc); TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification); }
public static void AddCoverEvents(string eventTitle, DateTimeOffset eventDate, int Index) { string eventHeader = CalHeader(Index); CoverEventsCollection[Index] = new CoverEvents { title = eventTitle, date = eventDate.Date, header = eventHeader }; }
public static void ResetCoverEventsHeader(int index) { int eventsNum = CoverEventsCollection.Count; for (int count = index; count < eventsNum; ++count) { CoverEvents oddCoverEvent = CoverEventsCollection[count]; CoverEvents newCoverEvent = oddCoverEvent; newCoverEvent.header = CalHeader(count); CoverEventsCollection[count] = newCoverEvent; } }
public static void createTileUpdate(CoverEvents coverEvent) { string eventTitle = coverEvent.title; string eventDate = coverEvent.date.ToShortDateString(); string eventDays = coverEvent.days.Days.ToString(); string eventCheck = coverEvent.check; string content = $@" <tile> <visual branding='nameAndLogo'> <binding template='TileMedium' displayName='{eventDate}'> <text hint-style='title' hint-align='center'>{eventDays}</text> <text hint-style='caption' hint-wrap='true' hint-align='center' hint-maxLines='2'>{eventTitle}</text> </binding> <binding template='TileWide' displayName='{eventDate}'> <group> <subgroup hint-weight='5'> <text hint-style='subheader' hint-align='center'>{eventDays}</text> <text hint-style='bodySubtle' hint-align='center'>{eventCheck}</text> </subgroup> <subgroup hint-weight='6' hint-textStacking='center'> <text hint-style='body' hint-wrap='true' hint-align='center'>{eventTitle}</text> </subgroup> </group> </binding> <binding template='TileLarge'> <text hint-style='header' hint-align='center'>{eventDays}</text> <text hint-style='subtitle' hint-align='center'>{eventDate}</text> <text hint-style='bodySubtle' hint-align='center'>{eventCheck}</text> <text hint-style='subtitle' hint-wrap='true' hint-align='center' hint-maxLines='2'>{eventTitle}</text> </binding> </visual> </tile>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(content); TileNotification tileNotification = new TileNotification(doc); TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification); }