Esempio n. 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();
     });
 }
Esempio n. 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));
        }
Esempio n. 3
0
        public static Task <object> ShowAtPosition(IEnumerable <MMenuItem> menuitems, Point position, string title)
        {
            var _datas = new ObservableCollection <MMenuItem>(menuitems);

            return(MDilog.ShowAtPosition(new MenuView()
            {
                DataContext = _datas, Title = title
            }, position));
        }
Esempio n. 4
0
        public static Task <object> ShowFromView(IEnumerable <MMenuItem> menuitems, FrameworkElement attachView, string title)
        {
            var _datas = new ObservableCollection <MMenuItem>(menuitems);

            return(MDilog.ShowFromView(new MenuView()
            {
                DataContext = _datas, Title = title
            }, attachView));
        }
Esempio n. 5
0
        private static MDilog PrepareView(FrameworkElement view, bool isBackgroundTransparent, bool isHasCloseButton, bool isTapDismiss)
        {
            MDilog _view = new MDilog()
            {
                Content = view, _isBackgroundTransparent = isBackgroundTransparent, _isHasCloseButton = isHasCloseButton, _isTapDismiss = isTapDismiss
            };

            if (view is IDialogChild)
            {
                _view.PrepareDialogChild(view as IDialogChild);
            }
            return(_view);
        }