コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: Strengol/Anime_Quiz
        public MainPage()
        {
            this.InitializeComponent();
            this.DataContext = new SampleViewModel();
            IToastImageAndText02 trying_toast = ToastContentFactory.CreateToastImageAndText02();

            trying_toast.TextHeading.Text  = "Toast notification Example";
            trying_toast.TextBodyWrap.Text = "Animu Quiz app";
            ScheduledToastNotification giveittime;

            giveittime    = new ScheduledToastNotification(trying_toast.GetXml(), DateTime.Now.AddSeconds(2));
            giveittime.Id = "Any_ID";
            ToastNotificationManager.CreateToastNotifier().AddToSchedule(giveittime);
        }
コード例 #2
0
        public MainPage()
        {
            this.InitializeComponent();

            ApplicationView.PreferredLaunchViewSize      = new Size(770, 550);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;


            //notification
            IToastImageAndText02 weather_notifications = ToastContentFactory.CreateToastImageAndText02();

            weather_notifications.TextHeading.Text  = "Aplikacja pogodowa załadowana poprawnie";
            weather_notifications.TextBodyWrap.Text = "WeatherApp";
            ScheduledToastNotification giveittime;

            giveittime    = new ScheduledToastNotification(weather_notifications.GetXml(), DateTime.Now.AddSeconds(2));
            giveittime.Id = "Any_ID";
            ToastNotificationManager.CreateToastNotifier().AddToSchedule(giveittime);


            //live tiles
            var template = TileContentFactory.CreateTileSquare150x150PeekImageAndText01();

            template.TextBody1.Text = "Aplikacja pogodowa";
            template.Image.Src      = "ms-appx:///Assets/pogoda.png";

            var wideTemlate = TileContentFactory.CreateTileWide310x150PeekImageAndText01();

            wideTemlate.TextBodyWrap.Text    = "Aplikacja pogodowa - szerszy tile";
            wideTemlate.Image.Src            = "ms-appx:///Assets/pogoda.png";
            wideTemlate.Square150x150Content = template;

            TileNotification wideNotification = wideTemlate.CreateNotification();
            TileUpdater      updater          = TileUpdateManager.CreateTileUpdaterForApplication();

            updater.Update(wideNotification);
        }