In android there is a progress dialog class??
ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "",
"Loading. Please wait...", true);
Use the ProgressIndicator
<shell:SystemTray.ProgressIndicator>
<shell:ProgressIndicator IsIndeterminate="True" IsVisible="True" Text="Click me..." />
</shell:SystemTray.ProgressIndicator>
There is ProgressBar control comes with SDK, also PerformanceProgressBar in Silverlight Toolkit exists (a little bit better).
In WP7.1 you have an access to SystemTray. It has an option to show that some actions happen (indeterminate or in percents) with additional message if you want
Related
I'm trying to add a button to the command bar of a phone app (8.1 and UWP) with a typical Windows Phone share icon. How do I add such an icon to it?
I'd also like it to bring up the sharing window where the user can select the different ways of sharing something. It would share the link to my app in the store, like from the store app.
1: There is no share charm in Windows 10. What you can do is that you do the icon yourself. This would make it:
<AppBarButton Label="Share" >
<AppBarButton.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
</AppBarButton.Icon>
</AppBarButton>
2:
In UWP I would use Share contract. (Basically the DataTransferManager class…)
Here is a good documentation for that:
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/mt243293.aspx
Basically:
Hook up the event (e.g. in your page’s constructor..):
DataTransferManager.GetForCurrentView().DataRequested += MainPage_DataRequested;
Show the UWP share UI (e.g. on the button’s event handler..)
DataTransferManager.ShowShareUI();
Do the sharing:
private void MainPage_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
args.Request.Data.SetWebLink(URI);
args.Request.Data.Properties.Title = "My new title";
args.Request.Data.Properties.Description = "description";
}
Using any control from Windows Phone Toolkit in XNA/XAML hybrid project hangs application under certain conditions:
Create "Windows Phone XAML and XNA App" project
Add Silverlight for WP Toolkit by typing:
Install-Package SilverlightToolkitWP -Version 4.2012.6.25
in Package Manager Console
In MainPage.xaml add toolkit namespace:
<phone:PhoneApplicationPage
...
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
...>
Add any control from toolkit eg. TimePicker:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<!--Create a single button to navigate to the second page which is rendered with the XNA Framework-->
<Button Height="100" Content="Change to game page" Click="Button_Click" />
<toolkit:TimePicker />
</Grid>
Run app on WP8 device or WP8 emulator (on WP7 this problem doesn't exist)
Click "Change to game page" button
Lock and unlock screen or switch to another app then return.
Click back button to return to MainPage
Click on TimePicker and try to change time.
Application isn't killed but UI is blocked
I read that WP8 runs WP7 apps in 100% compatibility but it seems this isn't true...
I finally found the solution for this bug! It's very easy to fix but was difficult to discover. Here's the line of code you have to add to your game page class in OnNavigatedFrom(NavigationEventArgs e) method. You have to add this if statement:
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
// Stop the timer
timer.Stop();
// Set the sharing mode of the graphics device to turn off XNA rendering
if (e.IsNavigationInitiator)
SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(false);
base.OnNavigatedFrom(e);
}
That's not the right version of the toolkit for WP8. As of now you should use https://nuget.org/packages/WPtoolkit (October 2012 version, version 4.2012.10.30)
Could anyone tell me how to capture a long press for a windows store app in C#?
I can used a "tapped" gesture no problem but when I replace
TappedRoutedEventArgs with HoldingRoutedEvent it just doesn't register a holding gesture.
I'm testing this with my laptop so could it be that it doesn't recognize a mouse holding event?
I'm assuming there's similar functionality for the windows phone 7 but they're mostly for Silverlight which isn't used for Windows 8.
Any links/examples would be a great help!
Thanks!
Use the Holding Event:
XAML:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Holding="Grid_Holding_1">
</Grid>
CS:
private void Grid_Holding_1(object sender, HoldingRoutedEventArgs e)
{
Debug.WriteLine("You held at" + DateTime.Now.ToString());
}
You are correct about the mouse not firing the holding event. Run it in the simulator and then you can use the "Basic Touch Mode" to simulate the hold.
I need to programmatically force a (WP7 toolkit) ListPicker to show its list in full mode.
How can I do that (or how to send the tap gesture or click to indirectly do the same)?
Thanks!
You can set the ExpansionMode of the ListPicker to your desired style. Via XAML
<toolkit:ListPicker x:Name="MyListPicker"
ExpansionMode="FullScreenOnly"
>
....
</toolkit:ListPicker>
Or in code;
MyListPicker.ExpansionMode = ExpansionMode.FullScreenOnly
Hope that helps.
How can a user control be added to a page in Windows Phone 7 development?
I have the user control but I can't add it to a page....
Visual Studio doesn't support drag and drop to the canvas and I can't figure out how to declare it manually in the xaml.
Thanks in advance
You mean like:
<phone:PhoneApplicationPage>
<Views:MyUserControl />
</phone:PhoneApplicationPage>