I wanted to standardize popup in my application. So I created a user control for it and reference it as follow:
<!--<Popup x:Name="LoginPopup" Grid.ColumnSpan="2" Grid.RowSpan="2" Height="768" Width="1366" IsOpen="False">-->
<uc:StandardDialog Name="StandardDialog" Height="768" Width="1366" Grid.ColumnSpan="2">
.
.
.
</uc:StandardDialog>
<!--</Popup>-->
And in the code behind:
private void LoginClicked(object sender, RoutedEventArgs e)
{
StandardDialog.IsOpen = true;
//LoginPopup.IsOpen = true;
}
private void CloseLoginPopup(object sender, RoutedEventArgs e)
{
StandardDialog.IsOpen = false;
//LoginPopup.IsOpen = false;
}
However this failed with the following error, which points to the lines above:
Error 1 The name 'StandardDialog' does not exist in the current context C:\NSyncHg\MyApp.WinRT\Views\TestVisualAwarePage.xaml.cs 46 13 MyApp.WinRT
However if I were to uncomment the popup above and revert to the built in pop-up, everything compiles and run.
What am I doing wrong?