Monday 24 February 2014

Steve has to develop a windows Store app for displaying the various dishes available in a restaurant. The expected interfece of the app is shown in the following figure.

4. Steve has to develop a windows Store app for displaying the various dishes available in
   a restaurant. The expected interfece of the app is shown in the following figure.

Ans:= (XAML Code)

      <Grid Background="#FFD007F0">
          <ListView x:Name="lst" HorizontalAlignment="Left" Height="688" Margin="64,46,0,0" VerticalAlignment="Top" Width="337" FontSize="24" SelectionChanged="lst_SelectionChanged">
     
          </ListView>
          <Viewbox>
              <StackPanel x:Name="stk" Orientation="Vertical" Margin="722,10,100,34" Width="458">
                  <Image X:Name="img" Source="" HorizontalAlignment="Left" Margin="20,20,0,20" VerticalAlignment="Top"/>

   


(CCS Code)


     Privete void lst_SelectionChanged(object sender, SelectionChangedEventArgs)
      {
           if (lst.SelectedItem.ToString()=="Burger")
           {
               img.Source = new BitmapImage(New Uri("as-appx:///Assets/Burger.jpg"));
               head.Text = "Burger";
               para.Text = "Fresh juicy ham burgers at a pocket-friendly price of";
           }
           else if (lst.SelectedItem.ToString()=="Cheese Sandwich")
           {
             
               img.Source = new BitmapImage(New Uri("as-appx:///Assets/Cheese Sandwich.jpg"));
               head.Text = "Cheese Sandwich";
               para.Text = "Mouth-watering Cheese Sandwichs at a price of 2$";
           }
           else if (lst.SelectedItem.ToString()=="Noodles")
            {
             
               img.Source = new BitmapImage(New Uri("as-appx:///Assets/Noodles.jpg"));
               head.Text = "Noodles";
               para.Text = "Traditional Asian Noodles at a price of 3$";
           }
            else if (lst.SelectedItem.ToString()=="pasta salad")
            {
             
               img.Source = new BitmapImage(New Uri("as-appx:///Assets/Pasta salad.jpg"));
               head.Text = "Pasta salad";
               para.Text = "Zesty summary Pasta salad at a very low price of 2$";
           }
             else if (lst.SelectedItem.ToString()=="Pizze")
             {
             
               img.Source = new BitmapImage(New Uri("as-appx:///Assets/Pizze.jpg"));
               head.Text = "Pizze";
               para.Text = "Lip amacking classic Pizze at a rate of 5$";
           }
      }

No comments:

Post a Comment