logo
down
shadow

Back button control in windows phone app


Back button control in windows phone app

By : user2956712
Date : November 22 2020, 10:56 AM
This might help you I am developing a windows phone 8 app. I want to control the back button of the phone for doing specific task. I want that when user press the back button in specific page it will not navigate to the previous page but to the page which I want. Is their any way to control the hardware back button present in phone? , In Silverlight apps (WP7, WP8, WP8.1) you do this:
code :
protected override void OnBackKeyPress(CancelEventArgs e)
{
    // put any code you like here
    MessageBox.Show("You pressed the Back button");
    e.Cancel = true;                       
}
private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
    if (this.GoBackCommand.CanExecute(null) && !e.Handled)
    {
        e.Handled = true;
        this.GoBackCommand.Execute(null);
    }
}
using Windows.Phone.UI.Input;
HardwareButtons.BackPressed += OnBackPressed;
private async void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
    e.Handled = true;
    // add your own code here to run when Back is pressed
}


Share : facebook icon twitter icon
Handling hardware back button and sending it to WebBrowser control running on Windows Phone

Handling hardware back button and sending it to WebBrowser control running on Windows Phone


By : user2769420
Date : March 29 2020, 07:55 AM
this will help If you enable script on the WebBrowser control by setting IsScriptEnabled="true" you can then use the following to navigate backwards within the browser:
code :
private void backButton_Click(object sender, EventArgs e)
{
  try
  {
    browser.InvokeScript("eval", "history.go(-1)");
  }
  catch
  {
    // Eat error
  }
}
How to make Windows phone 8.1 listview to open list last selecteditem after pressed windows phone back button?

How to make Windows phone 8.1 listview to open list last selecteditem after pressed windows phone back button?


By : Kiran Kumar
Date : March 29 2020, 07:55 AM
wish help you to fix your issue If I understand correctly, when the users goes to a picture and comes back, the ListView is scrolled to the top, right? In this case, this is because the page instance is not preserved in cache so it loads again when you press the back button. You can stop this by setting NavigationCacheMode to Enabled:
code :
<Page x:Class="App.YourClass"
    NavigationCacheMode="Enabled"
</Page>
How to control windows phone 10 hardware back button

How to control windows phone 10 hardware back button


By : Rishabh Vats
Date : March 29 2020, 07:55 AM
I hope this helps you . Solved it with Handling Back button in Windows 10 UWP
Windows Phone 8.1 - How to handle Hardware back button GoBack with a Parameter back to the previous page

Windows Phone 8.1 - How to handle Hardware back button GoBack with a Parameter back to the previous page


By : EBS Team
Date : March 29 2020, 07:55 AM
With these it helps I solved this problem using singleton pattern where i created a controller class seen by all the mobile pages and through it i passes messages through them. Hope this answer helps you
Windows phone back button closes app instead of going back a page

Windows phone back button closes app instead of going back a page


By : wurq
Date : March 29 2020, 07:55 AM
wish helps you This is normal in Windows Phone 8.1. You may want to have a workaround in App.xaml.cs file.
Related Posts Related Posts :
  • Marshal.Copy attempted to read or write protected memory At Random Times
  • Restrict Type variable to specific class or subclass
  • Horizontal text alignment in a PdfPCell
  • C# crashing with Form.show() command, ObjectDisposedException - Deeper look / explanation please
  • Will the result of a LINQ query always be guaranteed to be in the correct order?
  • "Could not find default endpoint element that references contract"
  • Umbraco Request.QueryString is null if it's the first time the page is loaded
  • Error inconsistent accessibility method C#
  • How to program Intel Xeon Phi with C#?
  • remove nested element using regular expression
  • Is there a C# alternative to Java's vararg parameters?
  • Clear particular column values in DataTable
  • how to add event handler to programatically created checkboxes
  • Cannot apply indexing with [] to an expression of type 'System.Collections.Specialized.NameValueCollection'
  • Check for key in pre-existing dictionary in case insensitive manner
  • How to remove year from datetime object?
  • Accessing Settings in different ways
  • "This project is empty" error in Sonarqube
  • How to create reusable icon menu in Xamarin
  • Value Cannot be null in Ado.Net connectivity
  • Adding a custom/dynamic attribute when using XSD.exe
  • How to convert object to correct type
  • Automatically sign out from Forms Authentication in ASP.NET when browser is closed
  • Can a WCF service support both Buffered and Streamed transfer modes?
  • Verify a CA Certificate with a public key in C#
  • How to invoke a Web Service that requires the "patch" verb using the C# WebClient wrapper?
  • Proper way a implementing property based on generic type
  • Closing a form that is created in another thread
  • How Can You Bind a List<String> to a StackPanel
  • WPF Application Update Best Practices - Architectural Explanation
  • System.UnauthorizedAccessException in Server.MapPath()
  • Connecting and Using SQL Compact Edition in a WPF application
  • C#: weird ref in constructor to behave like "virtual field"
  • C# XDocument Load with multiple roots
  • How to decide what goes in the Domain or Application Project in a "DDD" solution?
  • How to get/set a property of an interface that is not always implemented
  • Read-only array field in unsafe struct
  • i got "Invalid attempt to call Read when reader is closed" when using sqldatareader how to solve it in a three
  • Why should I encapsulate objects in using if there is garbage collection
  • How to load Word document from byte array
  • Caliburn.Micro and ContextMenu for DataGrid Row
  • Linq "join" with a IList<T> getting "Error Unable to create a constant value.."
  • How to draw red wavy line under words in RichTextBox c# winform
  • HttpPostedFileBase returns Null MVC3
  • Refresh Dropdownlist in webform
  • How to convert serialized byte array back to its text form
  • How to do a loop to check all the variables at the same time for C#?
  • Facebook Sentiment Analysis API
  • Counting occurrences of specific letters in string
  • Module 'System.Data.Linq' Version=4.0.0.0, Culture=neutral, Publickeytoken=b77a5c561934e089' should be referenced
  • C# MVC Dynamically create view model
  • Get Executing Path of C# application when using nunit with Jenkins
  • GDI count stable near 100 but Handle count keep increasing
  • Problem adding string value to ViewBag from an MVC Action using TempData
  • Reading Excel file on condition
  • what is windows programming from C++, C# and Java perspective?
  • How to deal with C# object references in MongoDB?
  • How to create a list from filtering 2 lists with linq to object
  • Webclient calls to DownloadString cause my app to freeze
  • How to create a JSON WebService in c# ASP.Net with a valid JSON output and query with JQuery/Ajax
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org