I'm trying to achieve swipe navigation on Windows Phone 7. I would like to navigate from one page to another by swiping left or right. How can i do this?
You might want to investigate the pivot control -- this is like a tab control where left and right swipes move between pages. Some of the labs on Channel 9 cover them (here, look at Exercise 2 for a walkthrough of creating one).
Look at the GestureService and GestureListener in the Silverlight for Windows Phone Toolkit
You can have a horizontal ScrollViewer which contains a horizontal StackPanel. Then put your pages in the StackPanel. Check out http://wp7iphone.codeplex.com for an example of how to emulate the iPhone-style horizontal swipe interface with this approach.
If you want the scrollviewer to "snap" to the nearest page when the swipe stops, it can handle the ManipulationCompleted event and manually adjust its HorizontalOffset appropriately.
Related
I have a list and its scroll bar on the right along with two custom buttons representing upscroll and downscroll. These two buttons simulate scrolling by using list.setSelectedIndex(index, true) and are placed above and below my scrollbar via my custom layout.
I have two questions regarding this:
1). Since the upscroll and downscroll buttons are overlayed on top of the list, they disappear when i click elsewhere..and they kind of flash into appearance when i click the area it's supposed to be in. How can I remedy this behavior?
2). I have a scrollbar image that I have used in the "Scroll" theme in the GUI builder. It's alignment is IMAGE_ALIGNED_CENTER. However the scroll thumb doesn't reach the end of the bar when i scroll to the end of the list via my upscroll and downscroll buttons. The upscroll and downscroll buttons essentially scroll the list by one index with each press (using setSelectedIndex(index, true)).
Thanks
How do you overlay the buttons. I'm assuming you just set them into a specific location which disallowed as we can't possibly adapt them to the various resolutions. I suggest reading the developer guide section on layouts very carefully.
To place something on top of the list in a portable way you need to use the LayeredLayout or the LayeredPane and a Container + correct layout to position this within (e.g. BorderLayout EAST).
In this blog post there is a sample for making a scrollbar but it isn't "on top". It can be used as a starting point.
Hi i'm trying to get an effect similar to the way the marketplace displays apps. They have a horizontal list of six tiles that start in front and go off screen to the right. As you scroll the title for that view follows until you pass the final tiles then it goes to the next view of the panorama. This same effect is also used in the office hub with onenote. Any tips, suggestions or resources to help accomplish this?
You can implement this approach by using the Panorama control and by setting the Orientation property to Horizontal for this item. There's a How to on MSDN that walks through this scenario.
Can it be prevented that, when the user is viewing the last PanoramaItem, that he can scroll further to the right? - which moves back to the the first PanoramaItem.
(and, vice-versa, preventing to scroll from the first to the last by swiping to the left)
I'm asking this because in my app I have a panorama-page with only 2 PanoramaItems. The user can scroll from one to the other by swiping to the left or to the right. I want to prevent that other animation when scrolling beyond the last PanoramaItem.
Is it possible?
Sounds to me that you perhaps you shouldn't be using the Panorama at all. Looking at your other question about making the items smaller, it seems you want to push the Panorama beyond its designed purpose.
Perhaps you need is ScrollViewer with your two items (laid out using Grids) in a StackPanel with a horizontal orientation.
This is apparently how panorama is designed to work. There isn't a parameter to disable the capability.
Breaking from this behaviour would likely confuse users by introducing inconsistent behaviour between apps.
There are visual cues to indicate to the user that they are wrapping around with their scrolling action. The Title is displayed from the begining again and if your background image supports it, the join of the right side and left side indicates that the panorarma is wrapping around.
Can't find anchor property in WPF, was it reconstructed to Horizontal and Vertical Alignments?
Is it the same?
I wanted to stretch my control in both sides (right and left), but it worked rather different than anchor
You can do something like Anchor like this
<...HorizontalAlignment='Stretch' VerticalAlignment='Stretch' Margin='50,50,50,50'.../>
The Anchor and Dock properties of Windows Forms are replaced by appropriate layouting containers in WPF. Depending on what exactly you need you should be able to create your desired layout in WPF with the Grid or DockPanel containers.
There are small white circles at the edges of the control. Click them, and they will be converted to triangles which mean the edge is anchored.
I am developing a form in .NET Compact Framework, which hosts a variable number of controls. Every control should have the same width as the form. When there are only a few controls, no vertical scrollbar appears. When there are more controls than they can fit in one form, a vertical scrollbar appears. The width of the controls should then be modified, so that no horizontal scrollbar appears.
What is the best way to achieve this? I am interested in a solution that will work in all platforms/screen sizes and that can support screen orientation changes.
If I get this right, at one point, both a vertical and horizontal scrollbar appear, and you want only the vertical scrollbar? Doesn't setting the Anchor of each control to "Top|Left|Right" solve this problem automatically?
If every control is to be the same width as the form, why not just Dock every control to Top (or Bottom)? It'll take care of the resizing for you then. It might not look very attractive however, so I suggest adding in some empty Panels (docked the same way) to be used as vertical spacers.
I did some quick testing, and it seems, when you add controls, the panel raises the resize event when the added control tiggers the scollbars to go visible. The annoying part is here that the resize event is triggered a couple of times during startup :(
But knowing the compact framework, this might be your best shot at handling this.
Normally on the full framework you could if the DisplayRectangle is bigger than the size of the panel, but no such thing exists on the cf.
Hope this is of some help, I'll see if I can find anything more in the morning.