Introduction
Here in this article we will show a pop-up whenever a button is pressed.
Procedure
Step 1: Create a new “Silverlight Windows Phone Application” in Visual Studio and name it as you choose (I here named it "PopUpWP").
Now a new Windows Phone Application Page (MainPage.xaml) will be generated.
Step 2: Navigate to the MainPage.xaml of the XAML section in your code and add the following code:
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<!-- Setting a Rectangle having transparent background which set the
Visibility of popup -->
<Rectangle Name="popupRect" Fill="#80000000" Visibility="Collapsed"/>
<!—Here in the above Code we are just filling the rectangle With the transparent BackGround -->
<!—Creating A Border -->
<Border Name="popupBorder" Background="{StaticResource PhoneChromeBrush}" BorderBrush="Red" BorderThickness="2"
HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
<!-- Creating A grid Inside the Border and Rectangle -->
</Grid>
<!-- Setting Width and Height of The Grid -->
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<!-- Generating the Control which are the Two Radio Button here in this Example inside a Stackpanel -->
<RadioButton Content="(Option 1)" Tag="Option 1"/>
<RadioButton Content="(Option 2)" Tag="Option 2"/>
<Button Name="okButton" Grid.Row="1" Grid.Column="0" Content="Ok" Click="okButton_Click"/>
<Button Name="cancelButton" Grid.Row="1" Grid.Column="1" Content="Cancel" Click="cancelButton_Click"/>
<!-- Setting a Button Control In the Main Grid -->
<Button Name="popupButton" Content="Pop Me Up!" Margin="120,491,0,0" Height="75" HorizontalAlignment="Left" VerticalAlignment="Top" Width="190" Click="popupButton_Click"/>
The MainPage will look like this:


Sankar BcPosted Jan 22, 2016, 6:41 AM
thanks
Natheer Abu JarirPosted Oct 2, 2014, 1:44 PM
thanhs