Search code examples
listwindows-phone-8popupandroid-alertdialogisolatedstorage

Windows Phone 8 equivalent to Androids alert dialog?


In an Android project I have this kind of alert dialog:

Android Alert Dialog

I want to replicate this in Windows Phone 8, however I haven't been able to find a suitable plugin/widget to do so. The list itself is populated by SharedPreferences.

My plan for Windows 8 was to use Isolated Storage Files to grab the required entries, is this the best way?


Solution

  • <clippy>It looks like you want to display a list to the user and allow them to pick an option </clippy>

    If that is the case then you can use the ListPicker from the WP Toolkit. Install the nuget pack and use as such:

    <toolkit:ListPicker FullModeHeader="CHOOSE LOCATION" ItemsSource="{Binding Cities}">
         <toolkit:ListPicker.FullModeItemTemplate>
              <DataTemplate>
                   <StackPanel>
                        <TextBlock Margin="0,20" TextWrapping="Wrap"
                 Style="{StaticResource PhoneTextExtraLargeStyle}">
                             <Run Text="{Binding Description}" />
                             <Run Text="-" />
                             <Run Text="{Binding Quality}" />
                        </TextBlock >
                    </StackPanel>
                </DataTemplate>
        </toolkit:ListPicker.FullModeItemTemplate>
    </toolkit:ListPicker>