Need to scroll LongListSelector horizontally inside a pivotItem? - windows-phone-8

I want to scroll the LongListSelector Horizontally. This LongListSelector is inside a PivotItem.
I tried to put LongListSelector inside a scrollviewer, but not worked.
<ScrollViewer Width="800" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
<Grid x:Name="ContentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<phone:LongListSelector Name="AllImagesList" LayoutMode="Grid" GridCellSize="220,230"
ItemsSource="{Binding PhotoCollection}"
DataContext="{StaticResource viewModel}"
ItemTemplate="{StaticResource ImagesItemTemplate}"
SelectionChanged="onImageListSelectionChanged" />
</Grid>
</ScrollViewer>
</controls:PivotItem>
Is it possible to scroll a LongListSelector Horizontally?
If yes, Please help me , How?

Putting something that scrolls horizontally inside a Pivot control is a bad idea.
The Pivot control will be trying to detect horizontal swipe gestures and so these would be competing with your ScrollViewer. How would the framework know which item you wanted to react to the swipe? How would the person using the app know if their swipe gesture would scroll the list or change the selected pivot item?
There is a reason this doesn't work.
As an alternative, if appropriate, you may want to consider using a Panorama control instead as this can have items that are wider than the screen and so support some level of horizontal scrolling. This can't be combined with a vertically scrolling list well though.
A better approach would probably be to reconsider the design of this page.

Related

Disable Scrolling for touch input

I have this xaml in my page:
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<TextBlock Name="Content" IsTextSelectionEnabled="True"
FontSize="20"
TextWrapping="Wrap"
HorizontalAlignment="Right"/>
</ScrollViewer>
There is no option to horizontally scroll with the mouse. However, if I use touch mode (I use the simulator) I can drag the text from left to right with my 'finger'.
If I comment out the ScrollViewer this behaviour stops. I can only assume that Disabled HorizontalScrollBarVisibility is not preventing the touch user from scrolling horizontally. This is a minor annoyance, but how can I prevent this horizontal scrolling?
You'll also want to disable HorizontalScrollMode. HorizontalScrollBarVisibility is a separate property from the one that handles the actual behavior, which I get is a bit strange because 95% of the times you either Disable both or set both to Auto, bit I guess it is just an API design choice that gives you a bit more power.

Semi Transparent page over other page

I am working on a windows phone 8 application and I wish to add a semi transparent layer/page kind of thing over my current page to show some instructions to use the app to the user at start. Do someone know of some element or way with which this can be achieved?
Thanks
You cannot have overlap of two pages. However, for an overlay, you can simply add an extra grid and position everything inside it. Then you can use the Visibility property of your overlay Grid to show/hide the tutorial. Here's an example:
<phone:PhoneApplicationPage>
<Grid x:Name="LayoutRoot"> <!--This is your root grid-->
<Grid x:Name="ContentGrid">
<!--put actual content of the page here-->
</Grid>
<Grid x:Name="OverlayGrid" Visibility="Collapsed">
<!--put content of the overlay here-->
</Grid>
</Grid>
</phone:PhoneApplicationPage>
Now, whenever you want to display the overlay, do this in your code:
OverlayGrid.Visibility = Visibility.Visible;
That should do the trick.

How to set Column freeze in Grid?

How can I set Column Freeze inside Grid in XAML? I know that DataGrid have FrozenColumnCount, but I must to use Grid (DataGrid is not an option). I had idea that scroll viewer don't effect first (i.e. my "frozen" column), but I dont know how to do that. Some ideas? Please help :-)
As a Grid is just a means of providing layout (i.e it isn't something that directly displays data in the way a DataGrid goes) you will have to roll-your-own version of frozen columns. You should be able to do this easily by placing a ScrollViewer (or layout control of choice) within the section you want to scroll. Then place your content within the ScrollViewer (like another Grid, say)
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Column="1"/>
</Grid>

can't make ScrollViewer vertical scrollbar appear

In a Windows Phone 8 app, I have a simple example of a ScrollViewer with an ItemsControl inside
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Items}"/>
</ScrollViewer>
I can swipe up and down and the ItemsControl scrolls accordingly but I am not able to see the vertical scroll-bar.
I do not have any Style applied for ScrollViewers, this is a simple app.
Since the default of VerticalScrollBarVisibility is set to auto shouldn't the scroll-bar be visible?
I am confused, I tried to set it explicitly and it still doesn't work.
How to make it visible?
Is the ItemsControl height actually bigger than the ScrollViewer (thus hiding some items)?
The scrollbars only show up if there are actually hidden items that can only be reached by scrolling.

Move Button into grid space of a TabNavigator's tabs in Flex Builder

I have a layout question for Tab Navigators in Adobe Flex 3.
Is it possible to insert a button that invades the grid space of the tabs?
I have a tab navigator component and I am dynamically adding sub components to tab navigator and I want squeeze a button inside the tab space. I don't want the button to be another tab. And I don't want to use a TabBar for the tabs.
This graphic illustrates the problem.
This is the current layout I have
This is a mockup (photoshopped) of the layout I want. I basically want to shave some pixels off the layout.
Is there a way to push the button down or manually override its layout position in MXXML or actionscript?
I would think if you put the elements in a Canvas (which allows you to lay out elements absolutely) rather than a VBox as it appears you are using now, you could force the Home button to display the way you want it to, ie:
<mx:Canvas>
<mx:Button top="5" right="5" />
<mx:TabNavigator top="5" left="5" right="5" />
</mx:Canvas>