コード例 #1
0
        private void SendToastNotification(UnreadModel newValue, UnreadModel oldValue)
        {
            if (newValue.Follower != 0 && newValue.Follower != oldValue?.Follower)
            {
                ToastNotificationSender.SendText(Localization.Format("FollowerCount", newValue.Follower));
            }

            if (newValue.MentionStatus != 0 && newValue.MentionStatus != oldValue?.MentionStatus)
            {
                ToastNotificationSender.SendText(Localization.Format("MentionStatusCount", newValue.MentionStatus));
            }

            if (newValue.MentionCmt != 0 && newValue.MentionCmt != oldValue?.MentionCmt)
            {
                ToastNotificationSender.SendText(Localization.Format("MentionCmtCount", newValue.MentionCmt));
            }

            if (newValue.Cmt != 0 && newValue.Cmt != oldValue?.Cmt)
            {
                ToastNotificationSender.SendText(Localization.Format("CmtCount", newValue.Cmt));
            }

            if (newValue.Dm != 0 && newValue.Dm != oldValue?.Dm)
            {
                ToastNotificationSender.SendText(Localization.Format("DmCount", newValue.Dm));
            }
        }
コード例 #2
0
ファイル: RootView.xaml.cs プロジェクト: DinoChan/WeiPo
 private void RegisterNotification(string name, string localizationName)
 {
     Singleton <BroadcastCenter> .Instance.Subscribe(name, (sender, args) =>
     {
         if (args is long longArgs)
         {
             ToastNotificationSender.SendText(Localization.Format(localizationName, longArgs));
         }
     });
 }