internal MatchingWhistles GetWhistlerById(string id)
 {
     MatchingWhistles selectedWhistle = new MatchingWhistles();
     foreach (MatchingWhistles whistle in this.MatchingWhistles.matchingWhistles)
     {
         if (whistle._id.Equals(id))
         {
             selectedWhistle = whistle;
         }
     }
     return selectedWhistle;
 }
 public MatchingWhistles GetWhistleById(string id)
 {
     MatchingWhistles matchedWhistle = new MatchingWhistles();
     foreach (MatchingWhistles whistle in this.MatchingWhistles.matchingWhistles)
     {
         if (whistle._id.Equals(id))
         {
             matchedWhistle = whistle;
         }
     }
     return matchedWhistle;
 }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            selectedWhistler= (e.Parameter as MatchingWhistles);
            if (selectedWhistler.photo != null && !String.IsNullOrEmpty(selectedWhistler.photo))
            {
                userImage.ImageSource = new BitmapImage(new Uri(selectedWhistler.photo, UriKind.RelativeOrAbsolute));
            }

            if (AppData.selectedCategory.name.Equals("blood"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/BloodDonor_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("autoservice"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/AutoService_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("taxi"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Taxi_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("delivery"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Delivery_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("goldloan"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Loan_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                this.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("organicfood"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Organic_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("rent"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Rent_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("ride"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/RideShare_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("service"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Service_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("tickets"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Tickets_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("firstaid"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/FirstAid_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("travel"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/TravelHelp_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("personal"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Personals_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("community"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Community_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("food"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/Food_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
            else if (AppData.selectedCategory.name.Equals("others"))
            {
                BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/BloodDonor_SC.jpg", UriKind.Absolute));
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = bitmapImage;
                userNameGrid.Background = imageBrush;
            }
        }