Edit Tooltip design for Slider Control in WinRT XAML, Please click for referenceIs it possible to make the tooltip always visible?
Thanks in advance.
There's no way to change the slider's default behavior. You could consider showing the current value some other way, with a label or other visual.
For example:
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="{Binding ElementName=slider,Path=Value}"></TextBlock>
<Slider x:Name="slider" Maximum="100"></Slider>
</StackPanel>
I'm creating an image gallery that users can view by swiping an image to the left or right (horizontally) to see the next (or previous) image. Ideally, the image would snap into place like a hub section. I don't want to use a hub, however, due to memory concerns, as well as a hub isn't meant for this purpose.
I'm getting the first image to load, but I cannot swipe or move to another image in the collection. The first image loads, and I cannot slide it left or right.
Any help or suggestions would be appreciated.
Here's my relevant code:
ViewModel
Images = (await _service.GetImages(sectionId))
.Where(i => "Image".Equals(i.Type))
.SelectMany(sr => sr.Images
.Where(ii => "Standard Resolution".Equals(ii.Type))
.ToList();
(This above code successfully returns a list of image objects.)
XAML
<Grid x:Name="ImagesLayout" Grid.Row="1" Height="250">
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Visible"
ItemsSource="{Binding Images}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding Url}" Stretch="Fill" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
Here's a good article that outlines exactly how to implement an image carousel for Windows Phone 8.1. http://www.captechconsulting.com/blogs/windows-81-image-carousel
I have two different list and a title between them. How can I combine all of those and add them into a scrollview? Should I create all of my items and add them to a grid dynamically or is there a way that I can combine those with longlistselector?
Here is a pic of what I want to create:
Updated Solution
How about a <ScrollViewer> and two (2) <ItemControl> instead like so: Then set the ItemControl's ItemsSource to what ever list you have.
<ScrollViewer>
<StackPanel>
<!-- list #1 -->
<ItemsControl x:Name="list1" ItemsSource="{Binding YOURLIST_1}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding YOURTEXT}"></TextBlock>
<!-- ................ -->
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- header -->
<TextBlock Text="YOUR HEADER"></TextBlock>
<!-- list #2 -->
<ItemsControl x:Name="list2" ItemsSource="{Binding YOURLIST_2}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding YOURTEXT}"></TextBlock>
<!-- ................ -->
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
OLD Solution
That would be very difficult to do and probably very cumbersome. But it seems like you can achieve the same result with ONE LongListSelector if you were to Group your model items using a Key.
How to display data in a grouped list in LongListSelector for Windows Phone 8
Your "Header" will become your Key. Launch the Windows Phone News app, under the "Headlines" page you will see a good example of Grouping.
I am new to windows phone 8 development so any one can you please help me in getting the Original size images which is stored into the camera roll (sdcard) in windows phone. and how to swap images like only one image display in one page,next image in next page just like windows phone gallery.I want to develop app that capture images fro camera roll,but all images display same size here i use listbox & scrollviewer(can you provide simple code for this)
You should use Pivot Control and in its content load the image
<phone:Pivot x:Name="PivotAttachment"
ItemsSource="{Binding ObsDownloadedAttachments}" Foreground="Black" FontSize="48">
<phone:Pivot.ItemTemplate>
<DataTemplate>
<Image Grid.Row="1" Source="{Binding DownloadedBitmap}" />
</DataTemplate>
</phone:Pivot.ItemTemplate>
<phone:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding ImageUrl}"
Foreground="{Binding Converter={StaticResource ThemeColorBrushConverter}}" />
</DataTemplate>
</phone:Pivot.HeaderTemplate>
<!--Pivot item one-->
<!--Pivot item two-->
</phone:Pivot>
When using the Panorama control, elements in a non-active PanoramaItem respond to tap events. You can reproduce this with the following XAML, which is only very slightly modified from the Panorama Application solution template that ships with the Windows Phone 8 SDK. You can see how items in the second PanoramaItem are tappable, even when that PanoramaItem is not active.
<phone:Panorama Title="my application">
<phone:Panorama.Background>
<ImageBrush ImageSource="/PanoramaApp1;component/Assets/PanoramaBackground.png"/>
</phone:Panorama.Background>
<!--Panorama item one-->
<phone:PanoramaItem Header="first item">
<!--Single line list with text wrapping-->
<phone:LongListSelector Margin="0,0,-22,0" ItemsSource="{Binding Items}">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,-6,0,12">
<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeExtraLarge}"/>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</phone:PanoramaItem>
<!--Panorama item two-->
<phone:PanoramaItem>
<!--Double line list with image placeholder and text wrapping using a floating header that scrolls with the content-->
<phone:LongListSelector Margin="0,-38,-22,2" ItemsSource="{Binding Items}">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="12,2,0,4" Height="105" Width="432" Tap="SecondItem_OnTap">
<!--Replace rectangle with image-->
<Border BorderThickness="1" Width="99" Height="99" BorderBrush="#FFFFC700" Background="#FFFFC700"/>
<StackPanel Width="311" Margin="8,-7,0,0">
<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Margin="10,0" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeLarge}" />
<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
</StackPanel>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</phone:PanoramaItem>
</phone:Panorama>
Notice the "SecondItem_OnTap" Tap event handler hook-up in the LongListSelector.ItemTemplate in the second PanoramaItem.
I've observed this behavior in every app that isn't pre-installed on the phone, in other words, all non-Microsoft apps, including apps like Facebook and Pandora. Does anyone have
First, any insight as to why the behavior is different between Microsoft and non-Microsoft apps; and
Secondly, any suggestions on how to work around this behavior?
It's cumbersome, but you could capture the SelectionChanged event of the Panorama and disable clickable elements.
Yeah, this is a well known issue with panorama control. We addressed it in one of our apps by creating transparent overlay on top of inactive panorama item. Downside of this method is if you start side swipe on top of the overlay the gesture will be ignored. For our latest app we simply ignore this behaviour. If Microsoft was concerned about it they would fix it. As to why, well, Microsoft obviously doesn't use standard phone controls in their apps.
Thanks for the answers guys! I solved it with the following:
private void Panorama_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {
this.UpdateHitTestForPanoItems(this.Panorama.SelectedItem);
}
private void Panorama_OnLoaded(object sender, RoutedEventArgs e) {
this.UpdateHitTestForPanoItems(this.Panorama.SelectedItem ?? this.Panorama.Items.FirstOrDefault());
}
private void UpdateHitTestForPanoItems(object selectedItem) {
foreach (PanoramaItem item in this.Panorama.Items) {
item.IsHitTestVisible = item == this.Panorama.SelectedItem;
}
}
Of course, you'll need to actually hook up the Loaded and SelectionChanged events to the Panorama_OnLoaded and Panorama_OnSelectionChanged methods, respectively. I could also see moving this to a Behavior, which you could use on other Panoramas in your app.