Skip to content

Commit

Permalink
pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonz120 committed Dec 11, 2024
1 parent 23e6df5 commit b713956
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ namespace NuGet.PackageManagement.UI
public partial class PackageReadmeControl : UserControl
{
#pragma warning disable CS0618 // Type or member is obsolete
public IMarkdownPreview markdownPreview;
private IMarkdownPreview _markdownPreview;
#pragma warning restore CS0618 // Type or member is obsolete

public PackageReadmeControl()
{
InitializeComponent();
markdownPreview = MarkdownPreviewSingleton.GetInstance();
descriptionMarkdownPreview.Content = markdownPreview.VisualElement;
_markdownPreview = MarkdownPreviewSingleton.GetInstance();
descriptionMarkdownPreview.Content = _markdownPreview.VisualElement;
}

public ReadmePreviewViewModel ReadmeViewModel { get => (ReadmePreviewViewModel)DataContext; }
Expand All @@ -46,7 +46,7 @@ private async Task UpdateMarkdownAsync()
{
if (!string.IsNullOrWhiteSpace(ReadmeViewModel.ReadmeMarkdown))
{
await markdownPreview.UpdateContentAsync(ReadmeViewModel.ReadmeMarkdown, ScrollHint.None);
await _markdownPreview.UpdateContentAsync(ReadmeViewModel.ReadmeMarkdown, ScrollHint.None);
}
}
catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException)
Expand All @@ -63,7 +63,7 @@ private void UserControl_DataContextChanged(object sender, DependencyPropertyCha
{
ThreadHelper.JoinableTaskFactory.Run(async () =>
{
await markdownPreview.UpdateContentAsync("", ScrollHint.None);
await _markdownPreview.UpdateContentAsync("", ScrollHint.None);
});
oldMetadata.PropertyChanged -= ReadmeViewModel_PropertyChanged;
}
Expand All @@ -79,7 +79,7 @@ private void PackageReadmeControl_Unloaded(object sender, RoutedEventArgs e)
{
ThreadHelper.JoinableTaskFactory.Run(async () =>
{
await markdownPreview.UpdateContentAsync("", ScrollHint.None);
await _markdownPreview.UpdateContentAsync("", ScrollHint.None);
});
ReadmeViewModel.PropertyChanged -= ReadmeViewModel_PropertyChanged;
}
Expand Down

0 comments on commit b713956

Please sign in to comment.