private void BtnPage3_Click(object sender, RoutedEventArgs e)
        {
            // Find the frame.
            Frame pageFrame = null;
            DependencyObject currParent = VisualTreeHelper.GetParent(this);
            while (currParent != null && pageFrame == null)
            {
                pageFrame = currParent as Frame;
                currParent = VisualTreeHelper.GetParent(currParent);
            }

            // Change the page of the frame.
            if (pageFrame != null)
            {
                Page3 p3 = new Page3(uid);
                pageFrame.Navigate(p3);
                //pageFrame.Source = new Uri("Page3.xaml", UriKind.Relative);
            }
        }
 private async void Button_Click(object sender, RoutedEventArgs e)
 {
     Button b = sender as Button;
     bool navigate = true;
     if (FrmContent.Content.GetType() == typeof(Page2))
     {
         Page2 p2 = (Page2)FrmContent.Content;
         if (await p2.Savep2())
         {
             navigate = true;
             if (isCreate)
             {
                 LblPersonalInformation.Content = p2.TxtbxFirstName.Text.CapitalizeFirst() + " " + p2.TxtbxLastName.Text.CapitalizeFirst();
                 LblTags.Content = "";
                 selectedUID = p2.getUID();
             }
         }
     }
     if (navigate)
     {
         b.Background = System.Windows.Media.Brushes.Green;
         isCreate = false;
         switch (b.Name)
         {
             case "Btnp2":
                 Page2 p2 = new Page2(selectedUID);
                 FrmContent.Navigate(p2);
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp2.Content = "Personal";
                 break;
             case "Btnp3":
                 Page3 p3 = new Page3(selectedUID);
                 FrmContent.Navigate(p3);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
             case "Btnp4":
                 Page4 p4 = new Page4(selectedUID);
                 FrmContent.Navigate(p4);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
             case "Btnp5":
                 Page5 p5 = new Page5(selectedUID);
                 FrmContent.Navigate(p5);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
         }
         dgContentList.UpdateGrid();
         ShowHide();
     }
 }