Ejemplo n.º 1
0
        public static NS_MessageBoxResult ShowDialog(Window owner, string messageText, string messageDesctiption, NS_MessageBoxButtons buttons, NS_MessageBoxIcon icon)
        {
            MessageBoxWin content = new MessageBoxWin()
            {
                MessageText = messageText, MessageDescription = messageDesctiption, MessageBoxButtons = buttons, MessageBoxImage = icon
            };
            Window win = new Window();

            //NS.Controls.CustomControls.CustomWindow win = new NS.Controls.CustomControls.CustomWindow();
            if (owner != null)
            {
                win.Owner = owner;
                win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }
            else
            {
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            }



            //win.TitleLeft = true;
            win.SizeToContent = SizeToContent.WidthAndHeight;
            win.ResizeMode    = ResizeMode.NoResize;
            //win.ShowFullScreenButton = false;
            //win.ShowMinimizeButton = false;
            win.Content = content;
            win.ShowDialog();

            return(content.MessageBoxResult);
        }
Ejemplo n.º 2
0
        private static void OnCancelCommand(object sender, ExecutedRoutedEventArgs e)
        {
            MessageBoxWin cmb = sender as MessageBoxWin;

            if (cmb == null)
            {
                return;
            }
            cmb.MessageBoxResult = NS_MessageBoxResult.Cancel;
            Helper.FindParent <Window>(cmb).Close();
        }