Hi,
Thank you for your interest in Syncfusion products.
The following code will help you to hide the last item from the gallery.
int itemCount = this.galleryGroup.Items.Count;
if( itemCount > 0)
{
(this.galleryGroup.Items[--itemCount] as GalleryItem).Visibility = Visibility.Collapsed;
}
I have also created a simple sample to demonstrate how to add gallery item dynamically on Form load and hide/show item on button click event. Please navigate to the following link and see the sample.
http://files.syncfusion.com/support/Tools.WPF/7.1.0.30/80119/main.htmPlease feel free to contact us if you face any issues. We are very glad to assist you.
Thanks,
Prabu