Silverlight Modal Popup

Modal Popup naman!

Eto malupit sobrang dali!

magopen ka ng Expression Blend tapos create na new Silverlight2 App..

Copy and paste mo na lang to.. tinatamad ako magtype eh hahaha!

<Grid x:Name="LayoutRoot" Background="White">
        <Button x:Name="showPopup"  Click="showPopup_Click" Height="100" Width="100" Content="Show Popup"/>
        <Popup x:Name="myPopup" IsOpen="False" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="178,72,0,0" >
            <Canvas  Height="200" Width="300" Background="Azure">
                <Button x:Name="closePopup" Click="closePopup_Click" Height="50" Width="100" Content="Close Popup" Canvas.Top="133" Canvas.Left="94"/>
                <TextBox x:Name = "txtPasok" Height="25" Width="145" Canvas.Left="81" Canvas.Top="56" Text="TextBox" TextWrapping="Wrap"/>
            </Canvas>
        </Popup>
        <Canvas x:Name="myCanvas" Visibility="Collapsed" Background="Black"  Opacity=".4"></Canvas>
        <TextBlock x:Name="txtOutput" Height="26" Margin="249,132,224,0" VerticalAlignment="Top" Text="TextBlock" TextWrapping="Wrap"/>

    </Grid>

 

tapos ang code behind ay

public Page()
       {
           InitializeComponent();
       }

       private void closePopup_Click(object sender, RoutedEventArgs e)
       {
           txtOutput.Text = txtPasok.Text;
           myPopup.IsOpen = false;
           myCanvas.Visibility = Visibility.Collapsed;
       }

       private void showPopup_Click(object sender, RoutedEventArgs e)
       {
           myPopup.IsOpen = true;
           myCanvas.Visibility = Visibility.Visible;
       }

 

 

try mo.. astig yan.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s