示例#1
0
        private static void ExecuteNotified(object sender, ExecutedRoutedEventArgs e)
        {
            var toast = sender as Toast;

            if (toast != null)
            {
                var         obj = e.Parameter;
                INotifyItem notifyItem;
                if (obj is string)
                {
                    notifyItem = new ToastItem()
                    {
                        ToastContent = obj,
                        Thumb        = new Rectangle()
                        {
                            Height = 30,
                            Width  = 30,
                            Margin = new Thickness(7, 0, 7, 0),
                            Fill   = Brushes.SkyBlue
                        }
                    }
                }
                ;
                else
                {
                    notifyItem = (e.Parameter as INotifyItem);
                }
                toast.NewerNotifyItem = notifyItem;
            }
        }
示例#2
0
        public void ToastMessage(string title, string message)
        {
            var toastitem = new ToastItem()
            {
                ToastTitle   = title,
                ToastContent = new TextBlock()
                {
                    Text         = message,
                    TextWrapping = TextWrapping.Wrap
                },
            };

            this.NewerNotifyItem = toastitem;
        }