Ejemplo n.º 1
0
        public void Refresh()
        {
            container = DatabaseHandler.GetDatabase().GetContainer(id, container.GetLocation());

            //set title
            this.Title = container.GetName();


            //set proportions
            this.imageFrame.HeightRequest = MasterNavigationPage.current.Height / 2.0;



            //set text
            SetNotes();


            //init image

            if (ImageTools.HasImage(container))
            {
                if (ImageBaseHandler.current.isContainerCached(container.GetId()))
                {
                    SetImage(ImageBaseHandler.current.GetContainerImageSource(container.GetId()));
                }
                else
                {
                    SetImage(ImageTools.LoadImage(container));
                }
            }
            else //if no image give it the place holder image
            {
                Console.WriteLine("no image");
                SetImage("camera");
            }

            //init tags
            tagDisplay.ClearTags();
            if (container.GetTags().Count != 0 && !(container.GetTags().Count == 1 && container.GetTags()[0] == ""))
            {
                tagDisplay.AddTagToBatchWithoutClick(container.GetTags());
            }

            //remove uneeded lines
            if (container.GetNotes().Trim() == "")
            {
                notesLabel.Hide();
                notesDivider.Hide();
            }
            else
            {
                notesLabel.Show();
                notesDivider.Show();
            }



            //set colors
            this.BackgroundColor = PageColors.secondaryColor;
        }
Ejemplo n.º 2
0
 //sets the notes text
 private void SetNotes()
 {
     this.notesLabel.Text = container.GetNotes();
 }