void OnHelpTextReceived(object sender, IHelpDescriptor desc) { try { CurrentHelpText = new HelpDescriptorViewModel(desc); } catch (Exception) { CurrentHelpText = _defaultViewModel; throw; } }
public void UpdateHelpText(string helpText) { if (string.IsNullOrWhiteSpace(helpText)) { var textToDisplay = Resources.Languages.Core.StandardStyling.Replace("\r\n", "") + Resources.Languages.HelpText.WarewolfDefaultHelpDescription + Resources.Languages.Core.StandardBodyParagraphClosing; CurrentHelpText = new HelpDescriptorViewModel(new HelpDescriptor("", textToDisplay, null)); WebPageVisible = true; } else { WebPageVisible = false; var textToDisplay = Resources.Languages.Core.StandardStyling.Replace("\r\n", "") + helpText + Resources.Languages.Core.StandardBodyParagraphClosing; CurrentHelpText = new HelpDescriptorViewModel(new HelpDescriptor("", textToDisplay, null)); } OnPropertyChanged(() => WebPageVisible); }