Xamarin forms Horizontal listview showing images from ObservableCollection - xaml

I want to display Images/Thumbnails of photos that I've been taking in a horizontal view as a part of my content page.
I've stored the images paths as strings in a ObservableCollection. What's the best approach to do this in XAML and PCL.
Would be great if 3 or something images are shown on the screen, and standard image if no images have been added or if string is null, and to have these in a scrollview or listview so that all of the images in the ObservableCollection could be displayed.
maybe something like this
/Oliver

Use Bindable (Horizontal) Scroll View. see this link it's help you.
http://www.fabiocozzolino.eu/a-little-and-simple-bindable-horizontal-scroll-view/

Related

Xamarin Forms changing the size of a viewcell dynamically

Using a Xamarin Forms ListView with a custom ViewCell, is it possible to have a list item expand based on an event? Please ignore the orange lines, but reference the below picture...
Regular cell not expanded
User has tapped the triple dots causing the ViewCell to expand to show additional content
Is this possible? What is the technique to make that work?
You can have containers or elements inside your viewcell whose Visibility can be controlled based on the click. You will have to re render the elements once its expanded or collapsed for the viewcell to resize. Or else you will have the Viewcell being the size it was initially rendered, but the contents inside it overflowing.
Check out the following links :
How to implement Expandable/Collapsible ListView in xamarin forms?
CollapseListView-in-xamarin.forms
ExpandableListView

How do I move a canvas on the listview?

I want to keep an always topmost canvas on a listview. Canvas should be stretch on window and if the user tries to scroll listview, listview must scroll but canvas must be topmost transparently and user can see listview. My XAML tree like below that:
<Grid>
<ScrollViewer>
<ListView>
</ListView>
</ScrollViewer>
<Canvas Name="DxPanel"></Canvas>
</Grid>
I am trying to make a note taking app. The reqirements like that:
Each listview has image or richeditbox control (I have already done it)
The user can draw something on image or rich text
The listview must have infinite scroll ability and data of list view must retrieve from database and data and UI recycling must be supported.
The drawing layer must be endless scroll
I know this is hard challenge. I am planning to save stroke , and text data in db and image data in disk.
First of all, I need to say, there is no need to put a ListView inside a ScrollViewer, by default ListView can be scrolled if there are many items, this is because there is a ScrollViewer inside the template of ListView, you can refer to the default ListView styles and templates.
Then, if your Canvas keeps covering the ListView, there is no way for your ListView to get focused, let alone make the ListView scrolling. So I suggest you to rethink about this, why should your Canvas be topmost transparently?
If you want your ListView can be scrolled/focused, and in the meanwhile your layout in the Canvas can be seen, then you can put the ListView above the Canvas, by default the background of ListView is transparent.
You can leave a comment to tell us what is in your Canvas, why this Canvas should be stretch and placed on the top of the ListView, maybe we can try to find other way to solve your problem.

Windows Phone 8.1 Create a Swipeable Scrollable Control

I am trying to create an animation to a control.
So think of the animation and control of a now playing page on most touch screen devices. You see the control (album photo) and swipe either way and get it to slide off the screen and then the next control (album photo) slides on in its place.
I am not asking for you to code me this, but I am having trouble wrapping my head around a way that this could be done.
The control content is always changing, when you swipe one way, an image is removed from the view and then the next is added.
What you need is FlipView control which can get you the interface you described.
Here are some references:
Quickstart: Adding FlipView controls (XAML)
XAML FlipView control sample

How to show image as a Highslide popup in new view?

I am displaying images in xtype:dataview as thumbnail.
I am curious how to show the tapped image as a Highslide popup in a next view.
Can someone guide me in this?
A sample code will be much help full.
Do you mean a highslide gallery, with thumbnails underneath? There are lots of different types of highslides.
The best way would be to create a container with vbox....a carousel on top with a flex setting of 0.8, and a dataview underneath with a flex of 0.2.
Then, you can use the same store for both, load the dataview. Your tap listener for the dataview would do an animateactiveitem [index] of the carousel....the index will be take automatically from the dataview.
I ended up referring to the APOD carousel example by Ed SPencer, which pushes items into a carousel from a store first. The I loaded the store into both dataview and carousel at the same time, with an animateactiveitem showing the correct slide of the carousel on tap of the dataview.
I don't have my laptop here to post some example code, but maybe start by looking at the ed spencer APOD carousel.
Hope this helps....
:-)

Paging Horizontally with vertical scroll on each page!

In my app I use a page control and a UIScrollView to page horizontally, I'd like to be able to enable vertical scrolling on each page. Now I know you can nest UIScrollViews in order to achieve this, there is however one problem in my project. Each of the pages uses a view controller consisting of a view, with a background image (different image for each page). This background image should not move while scrolling up and down.
Now what I want is the ability to have buttons, regular rect buttons, which I create in Interface Builder (since I want to be able to design and update the positions easily) and which then can be scrolled vertically.
So it should be like this:
You see a screen with a page-control on the bottom, above it an image with buttons over it. When you scroll sideways, you go to another page, again with an image (another one) and with different buttons. Now whenever you scroll vertically on a page, the buttons should be scrollable (so I can have a LOT of buttons on 1 page), but the image should maintain it's position.
So I figured, I just add another scroll view on top of the view with the background image. This works fine since I now have my buttons hovering over the background image and I have a separate nib file for each page including the buttons. But when I do it like this, the scrollview with the buttons becomes un-scrollable vertically. I don't know why this is happening, so could anyone suggest me how to achieve the wanted result?
I'd be really really grateful!
Thanks,
Fabian