// Initialize the app's tiles on the Start page. There are three different sizes of tiles users can // choose from. private void InitializeTiles() { tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); var mediumSquareTile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150PeekImageAndText01); var largeSquareTile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare310x310ImageAndText02); var wideTile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150PeekImage02); tileUpdater.EnableNotificationQueue(true); mediumSquareTile.GetElementsByTagName("text")[0].InnerText = "TicTacToe"; largeSquareTile.GetElementsByTagName("text")[0].InnerText = "TicTacToe"; wideTile.GetElementsByTagName("text")[0].InnerText = "TicTacToe"; var node1 = wideTile.ImportNode(mediumSquareTile.GetElementsByTagName("binding")[0], true); wideTile.GetElementsByTagName("visual")[0].AppendChild(node1); var node2 = wideTile.ImportNode(largeSquareTile.GetElementsByTagName("binding")[0], true); wideTile.GetElementsByTagName("visual")[0].AppendChild(node2); var testNotification = new TileNotification(wideTile); testNotification.Tag = "Test"; tileUpdater.Update(testNotification); badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication(); }
public LiveTiles() { tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); tileUpdater.EnableNotificationQueue(true); badgeUpdater = BadgeUpdateManager.CreateBadgeUpdaterForApplication(); toastNotifier = ToastNotificationManager.CreateToastNotifier(); }
public MainPage() { InitializeComponent(); _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); _tileUpdater.Clear(); _tileUpdater.EnableNotificationQueue(false); }
/// <summary> /// Initializes a new instance of the <see cref="TileService" /> class. /// </summary> /// <param name="tileUpdater">The tile updater.</param> /// <exception cref="System.ArgumentNullException"></exception> public TileService(TileUpdater tileUpdater) { if (tileUpdater == null) { throw new ArgumentNullException("tileUpdater"); } _tileUpdater = tileUpdater; _tileUpdater.EnableNotificationQueue(true); }
public void Run(IBackgroundTaskInstance taskInstance) { BackgroundTaskDeferral deferral = taskInstance.GetDeferral(); tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); tileUpdater.EnableNotificationQueue(true); AddTileNotification("Hey Everyone... Whats up", "tag1"); AddTileNotification("Come see the new coffee shops", "tag2"); AddTileNotification("I need caffine", "tag3"); AddTileNotification("I drink coffee therfore I live", "tag4"); AddTileNotification("Caffine Drip please", "tag5"); GetData(); deferral.Complete(); }
public override void OnInitialize(IActivatedEventArgs args) { _eventAggregator = new EventAggregator(); _container.RegisterInstance<INavigationService>(NavigationService); _container.RegisterInstance<ISuspensionManagerState>(SuspensionManagerState); _container.RegisterInstance<IFlyoutService>(FlyoutService); _container.RegisterInstance<IEventAggregator>(_eventAggregator); _container.RegisterInstance<ISettingsStoreService>(new SettingsStoreService()); _container.RegisterInstance<IAssetsService>(new AssetsService("Logo.png", "WideLogo.scale-100.png")); _container.RegisterInstance<IResourceLoader>(new ResourceLoaderAdapter(new ResourceLoader())); _container.RegisterType<IRequestService, RequestService>(new ContainerControlledLifetimeManager()); _container.RegisterType<IAccountService, AccountService>(new ContainerControlledLifetimeManager()); _container.RegisterType<ICredentialStore, RoamingCredentialStore>(new ContainerControlledLifetimeManager()); _container.RegisterType<ICacheService, TemporaryFolderCacheService>(new ContainerControlledLifetimeManager()); _container.RegisterType<ITileService, TileService>(new ContainerControlledLifetimeManager()); _container.RegisterType<IAlertMessageService, AlertMessageService>(new ContainerControlledLifetimeManager()); _container.RegisterType<ISearchPaneService, SearchPaneService>(new ContainerControlledLifetimeManager()); _container.RegisterType<IEncryptionService, EncryptionService>(new ContainerControlledLifetimeManager()); // Register repositories _container.RegisterType<IProductCatalogRepository, ProductCatalogRepository>(new ContainerControlledLifetimeManager()); _container.RegisterType<IShoppingCartRepository, ShoppingCartRepository>(new ContainerControlledLifetimeManager()); _container.RegisterType<ICheckoutDataRepository, CheckoutDataRepository>(new ContainerControlledLifetimeManager()); _container.RegisterType<IOrderRepository, OrderRepository>(new ContainerControlledLifetimeManager()); // Register web service proxies _container.RegisterType<IProductCatalogService, ProductCatalogServiceProxy>(new ContainerControlledLifetimeManager()); _container.RegisterType<IOrderService, OrderServiceProxy>(new ContainerControlledLifetimeManager()); _container.RegisterType<IShoppingCartService, ShoppingCartServiceProxy>(new ContainerControlledLifetimeManager()); _container.RegisterType<IShippingMethodService, ShippingMethodServiceProxy>(new ContainerControlledLifetimeManager()); _container.RegisterType<IIdentityService, IdentityServiceProxy>(new ContainerControlledLifetimeManager()); _container.RegisterType<ILocationService, LocationServiceProxy>(new ContainerControlledLifetimeManager()); // Register child view models _container.RegisterType<IShippingAddressUserControlViewModel, ShippingAddressUserControlViewModel>(); _container.RegisterType<IBillingAddressUserControlViewModel, BillingAddressUserControlViewModel>(); _container.RegisterType<IPaymentMethodUserControlViewModel, PaymentMethodUserControlViewModel>(); // <snippet302> ViewModelLocator.SetDefaultViewTypeToViewModelTypeResolver((viewType) => { var viewModelTypeName = string.Format("Kona.UILogic.ViewModels.{0}ViewModel, Kona.UILogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=634ac3171ee5190a", viewType.Name); var viewModelType = Type.GetType(viewModelTypeName); return viewModelType; }); //</snippet302> // <snippet800> _tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(); _tileUpdater.EnableNotificationQueue(true); _tileUpdater.StartPeriodicUpdate(new Uri(Kona.UILogic.Constants.ServerAddress + "/api/TileNotification"), PeriodicUpdateRecurrence.HalfHour); // </snippet800> }
/// <summary> /// 刷新磁贴 /// </summary> /// <param name="updator">传入更新类型参数:应用磁贴,二级磁贴</param> private void UpdateTile(TileUpdater updator) { updator.Clear(); updator.EnableNotificationQueue(true); XmlDocument tile = new XmlDocument(); foreach (var item in gridNameDict) { tile = Windows.UI.Notifications.TileUpdateManager.GetTemplateContent(item.Key.Value); var imageElement = tile.GetElementsByTagName("image")[0]; imageElement.Attributes.GetNamedItem("src").NodeValue = "ms-appdata:///local/" + item.Key.Key + this.title??"" + ".png"; var notification = new Windows.UI.Notifications.TileNotification(tile); updator.Update(notification); } }
private void GetTileUpdate() { notifier = TileUpdateManager.CreateTileUpdaterForApplication(); notifier.EnableNotificationQueue(true); }