Esempio n. 1
0
        /// <summary>
        /// Shows death saves dialog
        /// </summary>
        public (int?, int?) ShowDeathSavesDialog(int successes, int failures)
        {
            ModalDialog modalDialog = new ModalDialog();

            if (_parentWindow != null)
            {
                modalDialog.Owner = _parentWindow;
            }

            DeathSavesViewModel deathSavesViewModel = new DeathSavesViewModel(successes, failures);
            DeathSavesView      deathSavesView      = new DeathSavesView(deathSavesViewModel);

            modalDialog.WindowTitle  = "Death Saving Throws";
            modalDialog.Body         = deathSavesView;
            modalDialog.Confirmation = deathSavesView.ViewModel;

            bool?result = ShowDialog(modalDialog);

            return(result == true ? ((int?)deathSavesViewModel.Successes, (int?)deathSavesViewModel.Failures) : (null, null));
        }
Esempio n. 2
0
        /// <summary>
        /// Creates an instance of <see cref="DeathSavesView"/>
        /// </summary>
        public DeathSavesView(DeathSavesViewModel viewModel)
        {
            InitializeComponent();

            DataContext = viewModel;
        }