示例#1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ImageBrush imageBrush = new ImageBrush();
            imageBrush.ImageSource = info.bitmapImage;
            LayoutRoot.Background = imageBrush;
            
            int babyid = -1;
            babyid = info.babyID;
            _babyViewModel = new BabyViewModel(babyid);

            DataContext = _babyViewModel;

            _babyViewModel.InitializeNewWeight();
        }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

            ImageBrush imageBrush = new ImageBrush();
            imageBrush.ImageSource = info.bitmapImage;
            LayoutRoot.Background = imageBrush;
            
            //imageBrush.ImageSource = new BitmapImage(new Uri(@"Assets/Photo0277_edited.jpg", UriKind.Relative));
            int babyid = -1;
            babyid = info.babyID;
            _babyViewModel = new BabyViewModel(babyid);
            
            DataContext = _babyViewModel;

            llsWeight.ItemsSource = _babyViewModel.Weight;

        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ImageBrush imageBrush = new ImageBrush();
            imageBrush.ImageSource = info.bitmapImage;
            LayoutRoot.Background = imageBrush;

            int babyid = -1;
            string selectedIndex = "";
            if (NavigationContext.QueryString.TryGetValue("babyid", out selectedIndex))
            {
                babyid = int.Parse(selectedIndex);
                _babyViewModel = new BabyViewModel(babyid);
            }
            else
            {
                _babyViewModel = new BabyViewModel();
            }

            DataContext = _babyViewModel;

            _babyViewModel.InitializeNewWeight();
        }
示例#4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ImageBrush imageBrush = new ImageBrush();
            imageBrush.ImageSource = info.bitmapImage;
            LayoutRoot.Background = imageBrush;

            int babyid = -1;
            babyid = info.babyID;
            _babyViewModel = new BabyViewModel(babyid);

            DataContext = _babyViewModel;
            try
            {
                babyPhoto.Source = info.getBabyPhoto(_babyViewModel.Baby.PhotoURI);
            }
            catch
            {
                babyPhoto.Source = new BitmapImage(new Uri(@"Assets/PanoramaBackground.png", UriKind.Relative));
            }

            birthWeight.Text = _babyViewModel.BirthWeight.BabyWeight; 
                     

        }