Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WinUIGallery/Controls/SampleCodePresenter.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IList<ControlExampleSubstitution> Substitutions
set { SetValue(SubstitutionsProperty, value); }
}

public bool IsEmpty => Code.Length == 0 && CodeSourceFile == null;
public bool IsEmpty => string.IsNullOrEmpty(Code) && string.IsNullOrEmpty(CodeSourceFile);

private string actualCode = "";
private static Regex SubstitutionPattern = new Regex(@"\$\(([^\)]+)\)");
Expand All @@ -87,7 +87,7 @@ private static void OnDependencyPropertyChanged(DependencyObject target, Depende

private void ReevaluateVisibility()
{
if (Code.Length == 0 && CodeSourceFile == null)
if (IsEmpty)
{
Visibility = Visibility.Collapsed;
}
Expand Down