コード例 #1
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            var value = rand.Next(1, 10);

            NotifyMessage msg = null;

            if (value % 2 == 0)
            {
                msg = new NotifyMessage("Images/GreenSkin.png", "Green Skin Title", "Du hast dich heute nicht viel bewogen. Willst du Spiel starten?",
                                        () =>
                                    MessageBox.Show("Green Skin has been chosen.", "Green Skin", MessageBoxButton.OK));
            }
            else
            {
               /* msg = new NotifyMessage("Images/BlueSkin.png", "Blue Skin Title", "Blue Skin has been chosen.",
                    () =>
                        MessageBox.Show("Blue Skin has been chosen.", "Blue Skin", MessageBoxButton.OK));*/
            }

            notifyMessageController.EnqueueMessage(msg);
        }
コード例 #2
0
 public NotifyMessageViewModel(NotifyMessage content, AnimatedLocation location, Action closedAction)
 {
     this.content = content;
     this.location = location;
     this.closedAction = closedAction;
 }
コード例 #3
0
 public void EnqueueMessage(NotifyMessage msg)
 {
     QueuedMessages.Enqueue(msg);
     Start();
 }