I'm wondering if it is possible to leave out the Uri QueryString parameter so that when a user pins a tile, it may not link to the application. This would be for design reasons when pinning several ShellTiles onto the Start Screen. The user would of course have the option to delete the tile manually from the Start Screen or from a button within the app itself. It seems when trying this I am still taken to the application but a debug error also occurs.
An example of when I create the ShellTile is as follows
ShellTile.Create(new Uri("/MainPage.xaml?" + Constants.Key + title, UriKind.Relative), LiveTile);
Can this be modified somehow?
Your secondary tile must have unique navigation URI. However you could navigate to some page that would immediately close itself. It is not the best solution but there isn't any better way.
For uniqueness just use Guid. You can close app in code with Application.Current.Terminate() for example.
Related
I have a value on screen1 which keeps on incrementing from 0 and when I navigate to screen2 it has to stop. When I navigate back it has to start incrementing from the stopped value.
How do I catch the current page change in Xamarin C# like wise OnAppearing and OnDisappearing for the app
Thanks!
Do you use NavigationPage?
If yes, you can use its Pushed and Popped events.
If no, please describe how exactly you implement your navigation.
In my app I give a alert, if the user wants to confirm the offer or not.
Now I noticed that if the user hits the home button, the alert stays there & makes my app crash if he would enter anything.
How can I remove the alert (all UIAlerts) when I go to background mode?
Kind regards,
Glenn.
Edit 1:
Basically I a making a offer page. When the user clicks OK, I am showing a UIAlert for extra confirmation.
Now I also have functionality that when a user closes (home button) the app & restarts it, it will go to the overview page (where all the products are) and will ask the server for the data (makes the data up -to-date again.).
Normally there would be no problem with my app going into background mode. But with the functionality of refreshing the data & going to another controller it probaly gives problems. Therefore I need to be able to close all the UIAlerts still active.
You app crashes not because of UIAlerts but because something is going wrong. Even if you put an app in the background while showing a UIAlert, the alert stays there.
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
you can use it with this method in AppDelegate.m:
- (void)applicationDidEnterBackground:(UIApplication *)application
but Nikos M. was right: you should find and fix the source of this problem, but not to disguise it. there is a simplest way to show alert, check it, may be it'll help:
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Title" message:#"Some message" delegate:nil cancelButtonTitle:#"Ok" otherButtonTitles:nil];
[alertView show];
I'm working in WP8 and I would like to know if it's possible to redirect the user to a custom page instead of the default MainPage when the application's tile is pressed.
For example, Toast Notifications have a NavigationUri that let's you enter a custom page to load after it's pressed. On tiles you can only get that information and not set it.
So there is any other way or I'm missing something?
This is all covered nicely in this blog post: http://blogs.msdn.com/b/ptorr/archive/2010/08/28/redirecting-an-initial-navigation.aspx?wa=wsignin1.0
Essentially the idea is to cancel the default navigation and then request a navigation to whichever Page you want.
When you are creating the tile, you are specifying the URL to which to navigate. Simply include an additional parameter, such as comingFrom and set it to tile - in the view OnNavigatedTo, check whether the parameter is present (QueryString is your friend).
If it is - you navigated from a tile. If it's not - you didn't.
Sounds like you need a SecondaryTile. SecondaryTiles allow you to navigate to a different page than your "MainPage" if you so desire.
Here is an example of how to create a secondary tile
ShellTile tileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("Page2.xaml"));
if (tileToFind == null) // have not pinned this page yet!
{
// Create the tile if we didn't find it already exists.
var tileData = new StandardTileData
{
Title = "Navigate To Page2",
};
// Create the tile and pin it to Start. This will cause a navigation to Start and a deactivation of our application.
ShellTile.Create(new Uri("/Page2.xaml", UriKind.Relative), tileData);
}
This will place a new tile on the start screen and when you tap it, it will navigate to Page2.
I define an IconicTile and and create it as such:
ShellTile.Create(new Uri("/MainPage.xaml?id=Iconic", UriKind.Relative), icontile, true);
The app closes and the user gets to the start-screen, where the live-tile got just pinned.
How could I achieve the same effect, without leaving the app?
You can't (create a Start screen tile without the user seeing what your app is doing).
I've some questions .. and I really need your help.
I have an application.
First I display a splash screen, a form, and this splash would call another form.
Problem: When the splash form is displayed, if I then open another application on the top of the splash, and then minimize this newly opened application window, the splash screen becomes white. How do I avoid this? I want my splash to be displayed clearly and not affected by any application.
I'm using a DropDownList but I realized that there is 2 types of it . I found "Dropdown" which makes the text inside the DDL editable, and "DropDownList" which doesn't.
Problem: when I tried to use DropDownList control it doesn't allow me to add a default text while DropDown does so I want a DropDownList control which prevent modifying on the text and allow a default text .. what property should I use?
Can I add "?" which denotes to Help button to the FormBorder (with the minimization, maximization, and close buttons )
Can I change the colour of the Formborder from its default colour (blue) ?
One of my application functionality is to copy files from server to phone into a certain folder in memory card.
Problem : can I determine the free size of the MMC to notify the user if it's full while copying.
3) You have to set the "HelpButton" property of the form to true. However the "?" button is only visible if you deactivate the maximize and minimize buttons by setting "MinimizeBox" and "MaximizeBox" to false.
Here are a few...
1) you need to launch the window in another thread so that your app can do what it needs to do to start. When the startup finishes, signal to the splash screen that it can close itself.
2)
dropDownList.SelectedIndex = 0;
4) I would not recommend doing so. It is based on the system color scheme, which the user sets. I would not like an app to decide for itself which scheme to use.
5) if the MMC shows up as a mapped drive you could use one of these techniques
Once again there is no answer to this guys question.
Yes, do as the other guy said and launch the splash screen in its own thread.
There is only one type of ComboBox in .Net, However there is a property called DropDownStyle which sets its functionality.
Yes, I am clueless on how this one works and never needed it.
Yes you betcha, Its called non-client painting. you can find more info on it here http://www.codeplex.com/CustomerBorderForm/Wiki/View.aspx?title=Painting%20NonClient%20Area&referringTitle=Home
I Need more details on this.