Пример #1
0
 private void Show(ToastData data, DataTemplate template = null)
 {
     if (template == null)
     {
         template = this.Resources["iconToastTemplate"] as DataTemplate;
     }
     container.ContentTemplate = template;
     container.Content         = data;
     if (DevUtil.DeviceFamily == DeviceFamilyType.Desktop)
     {
         if (data.Type == ToastIconType.None)
         {
             root.Height = 50;
             root.Width  = 280;
         }
         else
         {
             root.Height = 170;
             root.Width  = 270;
         }
     }
     if (ParentDialog == null)
     {
         MDilog.Show(this, true, false, false, true);
     }
     DispatcherUtil.Run(() => {
         VisualStateManager.GoToState(this, "ShowState", true);
         TryStartTimer();
     });
 }
Пример #2
0
        public static Task <object> Show(IEnumerable <MMenuItem> menuitems, string title)
        {
            var _datas = new ObservableCollection <MMenuItem>(menuitems);

            return(MDilog.Show(new MenuView()
            {
                DataContext = _datas, Title = title, Width = Window.Current.Bounds.Width - 24
            }, false, false, true));
        }