Properly cast NavViewItem Profile tags

This commit is contained in:
Carlos Zamora 2020-12-29 12:58:45 -06:00
parent ff84ee90e4
commit 9fea6deeb5

View file

@ -76,7 +76,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
if (const auto tag{ navViewItem.Tag() })
{
if (tag.try_as<Model::Profile>())
if (tag.try_as<Editor::ProfileViewModel>())
{
// hide NavViewItem pointing to a Profile
navViewItem.Visibility(Visibility::Collapsed);
@ -104,7 +104,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
if (const auto tag{ selectedItem.as<MUX::Controls::NavigationViewItem>().Tag() })
{
if (const auto oldProfile{ tag.try_as<Model::Profile>() })
if (const auto oldProfile{ tag.try_as<Editor::ProfileViewModel>() })
{
// check if the profile still exists
if (const auto profile{ _settingsClone.FindProfile(oldProfile.Guid()) })