Flipview Image Viewer


  • Hello,

    I have a flipview that holds images that I have taken from my webcam. What I want to do is allow users to click on the image and view it in an enlarged view.

    So far I have some code for an image viewer and for a pointer pressed method that I would place on the page where I take the image but I feel like I am doing too much work. Is there a way to to do this by just having a method to capture the click event and open a popup control of the enlarged image?

    Any help on how to do this would be greatly appreciated.

    Thank you

    Tuesday, July 29, 2014 2:17 PM

All replies

  • Put your image in a button and handle the button click event. This will automatically include keyboard focus support as well.

    You can modify the button template to remove borders and such.

    Tuesday, July 29, 2014 4:06 PM
  • Hi Rob,

    Since the images are in a flipview I started to add a pointer pressed method so that when the user clicks the image it will fire an event. But I would like to open a popup as opposed to my method which was a user control. I think its a lot more work than needed just to view an enlarged view of an image.

    Any solution as to how to go about it that way instead of a button? I can provide current code if needed.

    Wednesday, July 30, 2014 2:23 AM
  • Hi Rob,

    I was able to get a popup to display the image instead but it is not centering like it is supposed to. I have the following method to center all my popup controls and it has worked previously but has not worked on this popup:

    private void CenterPopup(Popup popup, bool autoHeight)
    popup.IsOpen = true;
    FrameworkElement child = popup.Child as FrameworkElement;
    child.Width = Window.Current.Bounds.Width - 200;
    popup.HorizontalOffset = 100;
    popup.VerticalOffset = (Window.Current.Bounds.Height - child.ActualHeight) /2;
    child.Height = Window.Current.Bounds.Height - 100;
    child.MaxWidth = child.Width;
    popup.VerticalOffset = 50;

    And when centering the item in the Tapped event for the image I just say: CenterPopup(imageWindow, true); and it is perfectly centered.

    But for this popup it seems to center on the page horizontally but not vertically. So it just is centered and is at the bottom of the frame. Any advice on how to fix this problem?

    Thursday, July 31, 2014 4:01 AM
  • If that code works with most popups but not with this one then what is different about this specific one?

    Can you reproduce the problem in a minimal sample and share that on your OneDrive?

    Thursday, August 7, 2014 11:39 PM