I have used Hub control in my Windows Phone 8.1 WinRT App.
I am dynamically populating the HubSections.
I don't want to go to last Hubsection once I have reached first Hubsection and same thing applies for Last Hubsection.
Default behaviour of Hub is that it scrolls from first Hubsection to last Hubsection.
Please Help!!
I guess you are looking for FlipView add content in it using FlipViewItem.
Hope it helps! :)
If you have a method like
panHub_SectionsInViewChanged(object sender, SectionsInViewChangedEventArgs e)
where in your xaml you have:
<Hub x:Name="panHub" Style="{StaticResource HubPanoramaStyle}" Margin="0, 0, 0, 0"
SectionsInViewChanged="panHub_SectionsInViewChanged" Loaded="panHub_Loaded" Grid.RowSpan="2">
Then the SectionsInViewChangedEventArgs e will have sections that moved into view and those out.
You could try scrolling to the last section if you are going from Last to First, like panHub.ScrollToSection(LastSection);
Related
I have a Windows 8.1 and i am using the playerFramework:MediaPlayer from codeplex (https://playerframework.codeplex.com/) and when I put my cursor on the seek bar or the timer i have a label that appears on the player. I have tried to play around with the style but have not found a way to remove this, has anyone been able to remove this label?
Here is my XAML Player code:
<playerFramework:MediaPlayer
x:Name="Player"
Height="281"
Width="498"
IsCaptionSelectionVisible="False"
IsFullScreenEnabled="True"
IsFullScreenVisible="True"
IsPlayPauseVisible="True"
IsResolutionIndicatorVisible="False"
IsSignalStrengthVisible="False"
IsSkipAheadVisible="False"
IsSkipBackVisible="False"
IsTimeElapsedVisible="True"
IsTimeRemainingVisible="True"
IsTrickPlayEnabled="False"
IsVolumeVisible="True"
SeekWhileScrubbing="True"
ThumbnailImageSource="{Binding
VideoDetails.Thumbnail480Uri,
Converter={StaticResource UriConverter}}" />
I have found the solution, after looking at the playerFramework:MediaPlayer style I found the element that shows the tips. This element is called Info, so i need to hide it. So basically you need to added IsInfoEnabled="False" to your MediaElement.
thus:
<playerFramework:MediaPlayer
x:Name="Player"
MinHeight="281"
MinWidth="498"
IsInfoEnabled="False"
ThumbnailImageSource="{Binding
Thumbnail480Uri,
Converter={StaticResource UriConverter}}"/>
I am trying to disable the scroll functionality in the phone:webbrowser in my windows phone 8 application. The reason i wan't to do this is that I want to place a stackpanel with items underneath the webview, but still show the whole webpage.
To accomplish this I get the total height of the webpage and set the height of the webbrowser to the webpage height. This will be done through adding javascript to the webbrowser. The webview will now have the total webpage and the items underneath it and both of those items are in a ScrollViewer so you can scroll through the page.
The only problem i have right now is that you can scroll the webbrowser so you cant scroll the scrollviewer. anyone got an idea how to fix this?
<ScrollViewer
Grid.Row="1"
Margin="0,0,0,0">
<StackPanel
x:Name="ContentPanel"
Margin="0,0,0,0">
<phone:WebBrowser
x:Name="webView"
Navigating="WebBrowserNavigating"
LoadCompleted="WebBrowserLoadCompleted"
ScriptNotify="browser_ScriptNotify"
IsScriptEnabled="True"/>
<StackPanel
x:Name="CouponHolder"
Margin="0,5,0,0">
</StackPanel>
</StackPanel>
</ScrollViewer>
I also looked at other questions, but they didnt work out for me:
http://www.codeproject.com/Tips/718671/Disable-WebView-scrolling-in-Windows-Store-Apps
And I see allot of people give awnsers like VerticalScrollBarVisibility="Disabled" but this doesnt work, like the suggests it will only hide the visibility...
you can disable all manipulation with WebBrowser control by setting IsHitTestVisible="false". The disadvantage is that you can't press Links, Navigate and so on.
If you want just to disable scrolling than take a look at this blog post:http://www.scottlogic.com/blog/2011/11/17/suppressing-zoom-and-scroll-interactions-in-the-windows-phone-7-browser-control.html
You can Find that the VisualTree of WebBrowser control looks like:
\-WebBrowser
\-Border
\-Border
\WebBrowserInteropCanvas (New in Windows Phone 8, missing in WP7)
\-PanZoomContainer
\-Grid
\-Border (you need access this one)
\-ContentPresenter
\-TileHost
You can get the last Border in VisualTree, and subscribe to ManipulationDelta, ManipulationStarted and ManipulationCompletedEvents. And set e.Handled = true; In event handlers. Be careful with that. For example where is no equialent for this code in Windows 8.1 and Windows Phone 8.1 (Runtime).
This hack will cancel scrolling of webbrowser while user can interract with entire web page, but you won't be able to suppress manipulation to put webbrowser in scrollviewer.
In general I don't think that you could achive ideal user experience if you put WebBrowser inside ScrollViewer
After hours of searching this project finally solved all our webview problems in Windows Phone 8.1 (bounce, touch, auto height etc.):
https://github.com/romshiri/sizeable-webview
I am new to WPF and xaml and I have a problem with my apps UI.
I am using this xaml code:
<ScrollViewer HorizontalAlignment="Left" Margin="252,12,0,0" Name="captchaControlsScrollableContainer" VerticalAlignment="Top">
<Grid Name="captchaControls" Width="339" Height="286">
</Grid>
</ScrollViewer>
And this code behind code that populates the grid:
captchaControls.Children.Add(new Captcha(data));
which is called more than one time
My problem is that only the first user control app apperas in the grid although in the debugger captchaControls.Children.Count is the right size and the scrollviewer's scrollbar is disabled.
Does anyone have any idea what I am doing wrong? Thank you in advance.
Your Grid in the scrollviewer is set to have 1 column and 1 row.So you will see only the last one you add so far (all others controls are "below" the last).
Take a look to the StackPanel control and maybe this tutorial will be useful.
(Scenario: Windows Phone 7 / Silverlight)
I have a ListBox that i will simplify to this XAML:
<ListBox ItemsSource="{Binding Path=ImageLinks}"> <!-- ImageLinks a collection in ViewModel -->
<ListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding Path=ImageSource}" /> <!-- ImageSource is a string with the url to the image-->
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Now, the above code works, but the problem is that as the item is rendered/loaded or whatever it starts downloading the image but while doing so, it blocks the UI. And since more than one item fits at the time, the UI gets blocked until all of the corresponding images are downloaded.
So, the question is, how do i get this functionality without the UI being blocked while downloading the images (and avoiding redownloading all of them each time the view gets navigated to)?.
Thanks in advance.
Well problem Solved, Thanks to all of you who took the time to help me.
Delay created a solution to exactly this problem.
See his blog entry on the topic at http://blogs.msdn.com/b/delay/archive/2010/09/02/keep-a-low-profile-lowprofileimageloader-helps-the-windows-phone-7-ui-thread-stay-responsive-by-loading-images-in-the-background.aspx
You could populate ImageLinks in a secondary thread that is not tied to the UI and bind it directly from the code-behind once it is populated instead of direct XAML binding.
You could also use the PersistentImageCache class from my Kawagoe toolkit, which has been designed precisely for this use case. Let me know if it helps! :)
So I have a Panorama control and the PanoramaItems are programmatically added to the control using the following template.
<UserControl>
<Grid x:Name="LayoutRoot">
<controls:PanoramaItem Name="sitePanoramaItem" Header="{Binding Name}">
<Controls:DockPanel VerticalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Controls:DockPanel.Dock="Top">
<Image Source="../Images/action.png" Width="64" />
<TextBlock Text="{Binding Stats, Mode=TwoWay}" FontSize="45" Margin="15,0,0,0" />
</StackPanel>
<Grid x:Name="graphCanvas" HorizontalAlignment="Stretch" Margin="10,10,10,10"> </Grid>
</Controls:DockPanel>
</controls:PanoramaItem>
</Grid>
</UserControl>
When I click on graphCanvas what I'd like to do is sorta pop the graphCanvas out and display that fullscreen then when I click again restore it to where it was. I've been all over this site and Google and can't find anything similar to what I'm looking for.
I would still like to maintain the Panorama control functionality so that the graphCanvas is still the only one visible but you can cycle through them. Currently I have it sorta working in that I remove the Grid from the DockPanel and put it directly in the LayoutRoot while making the sitePanoramaItem collapsed. However, it's not fullscreen as the Panorama name is still visible (I guess I could hide that as well...) When I put the graphCanvas back int he DockPanel the size of the canvas is all screwed up.
I was hoping there was a simpler way.
Is it even possible?
It is possible to create the UI you describe but it's not going to be simple. You're on the right track with removing it in code and adding it the LayoutRoot and making the Panorama hidden. However you would have to code the scrolling behavior yourself and that is going to be quite tricky - especially making it feel the way to panorama does.
One trick you could try is actually layer a PivotControl on top of your Panorama and have it be collapsed by default. Also edit it's template to remove all default content eg: remove the header control, set margins to 0, etc). Then when you want to go full screen you can remove all the graphCanvases from the Panorama items and and add them to new PivotItems in the PivotControl. Then hide the Panorama and show the Pivot. This will give you scrolling capability for free and the illusion of full screen.
Having said all that I'm not sure I would recommend this. The more common approach would be to simply be to navigate to another page when the user selects an item and handle the full screen aspects there (possibly using the Pivot control again for scrolling). And when you want to leave "fullscreen" mode simply navigate back to the first page. Handling Tombstoning of the fullscreen state will be much easier with this approach for one thing.
You can try making the graphCanvas a Page and putting it in a different XAML. Then add a frame (name it InnerFrame for example) in the same place where you have the graphCanvas right now and navigate to that page with InnerFrame. When the frame is clicked, you navigate with the RootFrame of the app to your graphCanvas page. When you decide to close it, just navigate back with the RootFrame.
Hope it's clear enough :)
Edit:
Navigation in WP7 works very similar as the standard navigation in Silverlight 4, but it's a bit more restrictive. Just throw a PhoneApplicationFrame in your XAML like this:
<phone:PhoneApplicationFrame x:Name="Frame" />
This is basically the same as a Silverlight frame. All the pages you create inherit from PhoneApplicationPage by default, so they can be showed in a frame without any changes.
Your whole application actually runs on a PhoneApplicationFrame. If you take a look at your App class you will see this:
public PhoneApplicationFrame RootFrame { get; private set; }
Here's the MSDN documentation for the navigation system on WP7