If you want to hide it by condition in your controller, you could achieve it only on this way, you should probably create a property in object that you'r returning from a controller, and that propertly might be called for example :
public static bool HideSamplePage {get; set;}
And what you might do on your View is next (I hope you know that Razor code blocks are enclosed in @{ ... })
@if(Model.HideSamplePage)
{
<mvcSiteMapNode title="Home" clickable="false" icon="fa fa-home" visibility="SiteMapPathHelper,!"></mvcSiteMapNode>
<mvcSiteMapNode title="Dashboard" controller="Dashboard" action="Index" icon="fa fa-dashboard"></mvcSiteMapNode>
<mvcSiteMapNode title="Master" clickable="false" icon="fa fa-info"></mvcSiteMapNode>
</mvcSiteMapNode>
}
else
{
<mvcSiteMapNode title="Home" clickable="false" icon="fa fa-home" visibility="SiteMapPathHelper,!"></mvcSiteMapNode>
<mvcSiteMapNode title="Dashboard" controller="Dashboard" action="Index" icon="fa fa-dashboard"></mvcSiteMapNode>
<mvcSiteMapNode title="Sample Page" controller="Sample" action="Index" icon="fa fa-info">
<mvcSiteMapNode title="Master" clickable="false" icon="fa fa-info"></mvcSiteMapNode>
</mvcSiteMapNode>
}
In code above I said if set state of property HideSamplePage to true,
then <mvcSiteMapNode title="Sample Page" controller="Sample" action="Index" icon="fa fa-info">
wont be shown/generated.
else
show SamplePage
also