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; }
public ItemListPage(StorageContainer containerIn) { this.Title = containerIn.GetName() + "'s Items"; this.container = containerIn; InitializeComponent(); Init(); this.Appearing += (sen, e) => Refresh(); }
private bool deleted = false; //whether or the page's container has been deleted public ContainerPage(StorageContainer container) { this.container = container; this.Title = container.GetName(); this.id = container.GetId(); InitializeComponent(); this.optionsTable.Margin = new Thickness(15, 5, 15, 5); InitButtons(); Refresh(); //the resfresh method also initializes the page }
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; //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 { SetImage("camera"); } //set colors this.BackgroundColor = PageColors.secondaryColor; }
public async void Edit() { NewContainerPage editPage = new NewContainerPage(container.GetName(), container.GetNotes(), container.GetTags(), container.GetId(), container, container.GetLocation()); await Navigation.PushAsync(editPage); }
public ContainerPanelViewText(StorageContainer container) { this.Children.Add(MakeTextLabel(container.GetName())); this.Children.Add(MakeTextLabel(container.GetNumberOfItems().ToString() + " Items")); }