locked
How to reload app? RRS feed

  • Question

  • Dear Windowsers,

    Happy new year

    I have written code to change app localization

    Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "ar-JO";
    How can I reload the app so that app changes strings, images, and FlowDirection. I need to refresh the hole app specially MainPage and charm

    Wednesday, January 2, 2013 8:39 AM

Answers

  • No need to reload your app, If you see this sample of localization you can get solution. Download the solution on this link http://code.msdn.microsoft.com/Application-resources-and-cd0c6eaa you will get it.

    Please remember to mark the replies as answers it will help others too.

    • Proposed as answer by RishiRajIT Thursday, January 3, 2013 10:14 AM
    • Marked as answer by Min ZhuMember Tuesday, February 5, 2013 6:55 AM
    Thursday, January 3, 2013 7:21 AM
  • Hi,

    There is no "Refresh" method to accomplish this. If you want to response to the culture change and update the UI immediately, please follow the Scenario 7 in the sample RishiRajIT posted above.

    Best regards,


    Min Zhu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Min ZhuMember Tuesday, February 5, 2013 6:59 AM
    Tuesday, February 5, 2013 6:58 AM
    Moderator

All replies

  • You don't have permission to close your app down with WinRT, nor to re-open.  You can however refresh the active page and refresh the share / search contract or the settings.
    Wednesday, January 2, 2013 9:06 AM
  • how can i refresh the active page?
    Wednesday, January 2, 2013 9:11 AM
  • Try:

    this.Frame.Navigate(this.GetType());

    That should work, although it may affect your navigation later on.

    Wednesday, January 2, 2013 10:19 AM
  • what about GoBack()?
    Wednesday, January 2, 2013 11:34 AM
  • Yes - that's what I meant when I said "it may affect your navigation".  I think you'd probably have to code around that (store a flag or something on refresh).
    Wednesday, January 2, 2013 11:36 AM
  • No need to reload your app, If you see this sample of localization you can get solution. Download the solution on this link http://code.msdn.microsoft.com/Application-resources-and-cd0c6eaa you will get it.

    Please remember to mark the replies as answers it will help others too.

    • Proposed as answer by RishiRajIT Thursday, January 3, 2013 10:14 AM
    • Marked as answer by Min ZhuMember Tuesday, February 5, 2013 6:55 AM
    Thursday, January 3, 2013 7:21 AM
  • Thank you RishiRajIT but there is no Refresh code
    Friday, January 4, 2013 4:14 PM
  • I think you can update the layout of the page by calling

    this.UpdateLayout();

    If that doesn't work then try one or more of the following

    this.InitializeComponent();

    this.InvalidateArrange();

    this.InvalidateMeasure();

    Please let us know which one if any works for you.

    Saturday, January 5, 2013 3:14 AM
  • really nothing worked
    Sunday, January 6, 2013 7:15 AM
  • What happened when you used GoBack() ? I think it should work too.

    Mohamad.


    • Edited by arabisoft Monday, January 7, 2013 10:02 PM
    Monday, January 7, 2013 10:02 PM
  • When I used 

    this.Frame.Navigate(this.GetType());

    BackButton will be shown, and new instance of MainPage will be created so I lost the old instance

    Tuesday, January 8, 2013 3:46 PM
  • oh, that's not what I meant. I mean instead of

    this.Frame.Navigate(this.GetType());

    just do

    this.GoBack();

    Wednesday, January 9, 2013 2:04 AM
  • Hi,

    There is no "Refresh" method to accomplish this. If you want to response to the culture change and update the UI immediately, please follow the Scenario 7 in the sample RishiRajIT posted above.

    Best regards,


    Min Zhu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Min ZhuMember Tuesday, February 5, 2013 6:59 AM
    Tuesday, February 5, 2013 6:58 AM
    Moderator