0

I am using Windows Phone Toolkit - Nov 2011 (7.1 SDK) and I want to display multiple listpickers each within a grid and each grid in a listbox. The problem is, only the first listpicker pops open and the rest don't. secondly how do I customize the full mode page of the listpicker to be displayed exclusively in Landscape orientation and set the page's "shell:SystemTray.IsVisible" to false.

Sorry I couldn't post a screenshot. error "Earn more than 10 reputation to post images".

Thanks

public MainPage()
    {
        InitializeComponent();
        for (int g = 0; g < 10; g++)
        {
            // Define the margins template dor elements
        Thickness elemThick = new Thickness();

        // Create the Grid that will hold all the elements of a single entry
        Grid entryGrd = new Grid();
        entryGrd.VerticalAlignment = VerticalAlignment.Top;
        entryGrd.HorizontalAlignment = HorizontalAlignment.Left;
        elemThick.Left = 0;
        elemThick.Bottom = 0;
        elemThick.Right = 0;
        elemThick.Top = 0;
        entryGrd.Margin = elemThick;
        entryGrd.Tag = lstbxPH.Items.Count;

        // Setup the backgound value of the letBoder element
        LinearGradientBrush elemLGB = new LinearGradientBrush();
        elemLGB.EndPoint = new Point(0.5, 1);
        elemLGB.StartPoint = new Point(0.5, 0);

        GradientStop AquamarineGS = new GradientStop();
        AquamarineGS.Color = Color.FromArgb(255, 127, 255, 212);
        AquamarineGS.Offset = 0;

        GradientStop greenLikeGS = new GradientStop();
        greenLikeGS.Color = Color.FromArgb(255, 101, 250, 193);
        greenLikeGS.Offset = 0.988;

        elemLGB.GradientStops.Add(AquamarineGS);
        elemLGB.GradientStops.Add(greenLikeGS);

        // Draw the letter 
        for (int x = 0; x < 9; x++)
        {
            Border letBoder = new Border();
            letBoder.Width = 53;
            letBoder.Height = 51;
            letBoder.VerticalAlignment = VerticalAlignment.Top;
            letBoder.HorizontalAlignment = HorizontalAlignment.Left;
            elemThick.Left = x * 60 + 71;
            elemThick.Top = lstbxPH.Items.Count * 1 + 20;
            letBoder.Margin = elemThick;
            letBoder.Background = elemLGB;

            // The Texblock
            TextBlock let = new TextBlock();
            let.VerticalAlignment = VerticalAlignment.Center;
            let.HorizontalAlignment = HorizontalAlignment.Center;
            let.FontSize = 25;
            let.FontWeight = FontWeights.Bold;
            let.Foreground = new SolidColorBrush(Color.FromArgb(200, 255, 255, 255));
            let.Text = x.ToString();
            let.Tag = x;
            letBoder.Child = let;
            entryGrd.Children.Add(letBoder);
        }


        // Draw the List picker element for the draw types
        ListPicker DType = new ListPicker();
        DType.Width = 48;
        DType.VerticalAlignment = VerticalAlignment.Top;
        DType.HorizontalAlignment = HorizontalAlignment.Left;
        DType.Background = new SolidColorBrush(Color.FromArgb(200, 255, 255, 255));
        DType.BorderBrush = new SolidColorBrush(Color.FromArgb(200, 255, 255, 255));
        elemThick.Left = 17;
        elemThick.Top = lstbxPH.Items.Count * 1 + 10;
        DType.Margin = elemThick;
        DType.FontSize = 18;
        ListPickerItem item1 = new ListPickerItem() { Content = "A" };
        ListPickerItem item2 = new ListPickerItem() { Content = "B" };
        ListPickerItem item3 = new ListPickerItem() { Content = "C" };
        DType.Items.Add(item1);
        DType.Items.Add(item2);
        DType.Items.Add(item3);
        entryGrd.Children.Add(DType);


        if (lstbxPH.Items.Count != 0)
        {
            // The delete button and related image
            Button btnDel = new Button();
            btnDel.Height = 65;
            btnDel.Width = 60;
            btnDel.Tag = lstbxPH.Items.Count;
            btnDel.VerticalAlignment = VerticalAlignment.Top;
            btnDel.HorizontalAlignment = HorizontalAlignment.Left;
            btnDel.VerticalContentAlignment = VerticalAlignment.Top;
            btnDel.HorizontalContentAlignment = HorizontalAlignment.Left;
            elemThick.Left = 600;
            elemThick.Top = lstbxPH.Items.Count + 13;
            btnDel.Margin = elemThick;
            elemThick.Left = 0;
            elemThick.Bottom = 0;
            elemThick.Right = 0;
            elemThick.Top = 0;
            btnDel.Name = "btnDel";
            btnDel.Padding = elemThick;
            btnDel.BorderBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
            Image imgDel = new Image();
            imgDel.Source = new BitmapImage(new Uri("/appbar.delete.rest.png", UriKind.RelativeOrAbsolute));
            imgDel.VerticalAlignment = VerticalAlignment.Top;
            imgDel.HorizontalAlignment = HorizontalAlignment.Left;
            imgDel.Height = 35;
            imgDel.Width = 30;
            elemThick.Left = 0;
            elemThick.Bottom = 0;
            elemThick.Right = 0;
            elemThick.Top = 0;
            imgDel.Margin = elemThick;
            imgDel.Stretch = Stretch.UniformToFill;
            btnDel.Content = imgDel;

            entryGrd.Children.Add(btnDel);
        }

        // Add the grid with to the list box
        this.lstbxPH.Items.Add(entryGrd);
        }
    }

1 Answers1

0

This issue was actually solved by the Windows Phone Toolkit - Nov 2011 (7.1 SDK). Here is how I worked it out.

  1. Download the November release of the toolkit http://silverlight.codeplex.com/releases/view/75888
  2. if you had a previous release of the toolkit installed, please uninstall it and unreferenced the tool kit on you project
  3. Install the November release of the toolkit
  4. Reference the toolkit on your project, debug and boom! it woks.