/// <summary> /// Shows short rest dialog /// </summary> public List <LevelModel> ShowShortRestDialog(List <LevelModel> levels, int conMod) { ModalDialog modalDialog = new ModalDialog(); if (_parentWindow != null) { modalDialog.Owner = _parentWindow; } List <LevelModel> levelsCopy = new List <LevelModel>(); foreach (LevelModel level in levels) { levelsCopy.Add(new LevelModel(level)); } ShortRestViewModel shortRestViewModel = new ShortRestViewModel(levelsCopy, conMod); ShortRestView shortRestView = new ShortRestView(shortRestViewModel); modalDialog.WindowTitle = "Short Rest"; modalDialog.Body = shortRestView; modalDialog.Confirmation = shortRestView.ViewModel; bool?result = ShowDialog(modalDialog); return(result == true ? levelsCopy : null); }
/// <summary> /// Creates an instance of <see cref="ShortRestView"/> /// </summary> public ShortRestView(ShortRestViewModel shortRestViewModel) { InitializeComponent(); DataContext = shortRestViewModel; }