locked
Handling application setting

    Question

  • Dear all,

    I am building a universal app application in c#/WPF which will collect data from web services.

    All web service call need to have a parameter key which is a kind of Token key.

    The application I am working on could work with different token key value and based on the key value provide, it will thme collect data from different source.

    Based on that I was Thinking that adding this key entry in a SettingFlyout control could be a good candidate for that.

    Then if the key is valid and enter correctly then all internal web service call will use that key value.

    Is this the correct approach for that ?

    Is it a kind equivalent to traditionnal  APP.config file

    regards

    Friday, April 10, 2015 7:37 AM

All replies

  • Maybe what you could do alternately is to send an initial HTTP request to a WebServer that you own and then return that key to the application before making the WebService call. That way you can "automate" this key entering process so that users of your application won't need to "enter" the key manually (and potentially cause human errors).

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Friday, April 10, 2015 8:35 PM
    Moderator
  • Not a bad solution.  You are really building a dictionary where an XML database (the config file) is the input to the dictionary.  XML files are frequently used as a database.

    jdweng

    Friday, April 10, 2015 9:35 PM
  • hello, thnaks for your answer

    I cannot user a separate web server where all my Customer key will be saved. THose key act in a kind of licence for the application, so if it is not enter it prperoerly it will not work.

    So based on that can I place that in settingFlyout ?

    I have an Other concern which is a filter. Before any data gets display in the application the user of the app will have to fillup different filter parameter.

    Question :

    Does that filter should be alos in a Customer SettingFlyout called Filter Flyoutor as a part of the application page?

    regards

    Monday, April 13, 2015 8:07 AM
  • The application settings are in an XML file (not very secure) and you can use any valid XML tag for the properties. It would make sense to store the filter parameters in the config file so the user wouldn't have to re-enter the filters every time the application was started.

    jdweng

    Monday, April 13, 2015 9:08 AM
  • Token you better save in the PasswordVault.

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, April 13, 2015 9:21 AM
  • @jdweng, what do you mean by better save it in config file ? do you mean similar config file as a app.config ?

    If filter are stored based on what I have seen from a SettingFlyout page, those parameters are store locaaly and can be retrive at application start correct ? so then it means I can recall last filter property setting and use those.

    @Dave, what do you mean by PasswordVault ?

    Based on wha I could read of SettingsFlyout, ther are use to handle the behaviour of the application so based on a design approach, I was Thinking to use that for filtering .

    regarsd

    Monday, April 13, 2015 9:30 AM
  • passwordvault is a safe place to save usernames/password

    see: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465069.aspx


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, April 13, 2015 9:32 AM
  • @Dave, the problem is password vauld is here to store login account in order to prevent user to re enter it. in my scenario it is not a login account it is just a Web service key .

    I do not have any username to provide in order to use ourweb service, just pass the key in each request. So how should I do then ?

    Once again the Key here is only use to web service data request in order to downlod proper data for the application.

    To help you understand here is the correct scnenario :

    Imagine a store app which is able to collect data from different retail store. The application is standard, to retrive the data from STORE 1, we will pass KEY1 and to retrive data for STORE2 we will pass the KEY 2.

    The application shows only data from a single store, we are not able to swap store in a single app

    regards

    Monday, April 13, 2015 9:39 AM