This is my first UWP app and I'm sure I just missing something very simple.

I am trying to build an openfilepicker allowing users to select which file types are to be included (.JPEG, .BMP etc) via a listbox. My problem is the value returned from my listbox is invalid. The value returned is "my solution name.page name.Classname" not the value that the user has selected in the list box (for example .JPEG").

XAML:

```
        <ListBox x:Name="lstPhotoType" Height="197" SelectionMode="Multiple" FontSize="12" VerticalAlignment="Top" Background="{x:Null}" SelectionChanged="lstPhotoType_SelectionChanged" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid VerticalAlignment="Top">
                        <TextBlock x:Name="pictureType" Text="{Binding pType, Mode=TwoWay}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" FontWeight="Bold" FontSize="12"/>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

```

My c# code:

```
       //Start creating the fileopenpicker.
        FileOpenPicker fileOpenPicker = new FileOpenPicker();
        fileOpenPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

        //Count the number of selected photos files.
        int count = lstPhotoType.SelectedItems.Count();

        //If 1 of  more photo type/s has been selected - build openpicker filetypefilter.
        if (count > 0)
        {
            foreach (object listBoxItem in lstPhotoType.SelectedItems)
            {
               // string value = Convert.ToString(listBoxItem);
                fileOpenPicker.FileTypeFilter.Add(listBoxItem.ToString());
            }
        }

```

Any suggestions would be greatly appreciated.

Edit 1

My class code for PictureTypes

```
    public class PictureTypes
    {
        public string pType { get; set; }
    }

    string[] arrayoftypes = new string[5] { "*All", ".BMP", ".JPEG", ".JPG", ".PNG"};

    public void makePictureTypeList()
    {
        for (int i = 0; i < 5; i++)
        {
            //Create a new instace of the PictureTypes class
            PictureTypes obj = new PictureTypes();

            //build array of data
            obj.pType = arrayoftypes[i];

            //Add the the picture types into the listbox
            lstPhotoType.Items.Add(obj);
        }
    }

```