dinesh
dinesh

Reputation: 735

Creating Popup programmatically in WP7

How to create the popup in program? e.g. I need to rename the file in phone App. How to do this by using popup in wp7?

Upvotes: 1

Views: 5158

Answers (2)

Derek Lakin
Derek Lakin

Reputation: 16319

Add a Popup element to your XAML and define the content using regular elements (as you would any other Page or UserControl. Set the Popup.IsOpen property to true to show the Popup and false to close the Popup. The following XAML shows an example that I use for showing in-application "toast" notifications with the Silverlight Windows Phone Toolkit

<Popup x:Name="_toast">
    <Grid x:Name="_toastContainer"
            VerticalAlignment="Bottom"
            Width="{Binding ActualWidth, ElementName=LayoutRoot}">
        <StackPanel Margin="14,10">
            <TextBlock Text="{Binding Title}"
                        HorizontalAlignment="Stretch"
                        TextWrapping="Wrap" />
            <TextBlock Text="{Binding Content}"
                        HorizontalAlignment="Stretch"
                        TextWrapping="Wrap" />
        </StackPanel>
    </Grid>
</Popup>

Upvotes: 3

Todd Main
Todd Main

Reputation: 29155

Take a look at the Input Prompt control in the Coding4Fun Windows Phone Toolkit

Upvotes: 1

Related Questions