Beispiel #1
0
        public static bool?ShowDialog(string message, BitmapSource bitmap, MessageBoxButton buttons)
        {
            KlaxDialog       dialog    = new KlaxDialog();
            CDialogViewModel viewModel = new CDialogViewModel(message, buttons, dialog.Close, bitmap);

            dialog.DataContext = viewModel;
            return(dialog.ShowDialog());
        }
Beispiel #2
0
        public static bool?ShowDialog(string message, Uri iconUri, MessageBoxButton buttons)
        {
            KlaxDialog       dialog    = new KlaxDialog();
            CDialogViewModel viewModel = new CDialogViewModel(message, buttons, dialog.Close, new BitmapImage(iconUri));

            dialog.DataContext = viewModel;

            return(dialog.ShowDialog());
        }
Beispiel #3
0
        public static bool?ShowDialog(string message, EDialogIcon icon, MessageBoxButton buttons)
        {
            ImageSource source = null;

            switch (icon)
            {
            case EDialogIcon.Warning:
                source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Windows/fa_warning.png"));
                break;
            }

            KlaxDialog       dialog    = new KlaxDialog();
            CDialogViewModel viewModel = new CDialogViewModel(message, buttons, dialog.Close, source);

            dialog.DataContext = viewModel;

            return(dialog.ShowDialog());
        }