public MainPage()
        {
            this.InitializeComponent();

            // This is a static public property that allows downstream pages to get a handle to the MainPage instance
            // in order to call methods that are in this class.
            Current          = this;
            SampleTitle.Text = ResourceManagerHelper.ReadValue("FeatureName");
            ListScenario     = new List <string>
            {
                ResourceManagerHelper.ReadValue("Scenario1")
            };
        }
Ejemplo n.º 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage           = MainPage.Current;
            this.activeAccount = (Account)e.Parameter;
            //read language related resource file .strings/en or zh-cn/resources.resw
            Run run1 = new Run();

            run1.Text = string.Format(ResourceManagerHelper.ReadValue("SelecteHelloDs1"), activeAccount.Name);
            Run run2 = new Run();

            run2.Text = ResourceManagerHelper.ReadValue("SelecteHelloDs2");
            this.textHelloDes.Inlines.Add(run1);
            this.textHelloDes.Inlines.Add(new LineBreak());
            this.textHelloDes.Inlines.Add(run2);
        }
        /// <summary>
        /// Gets the account list file and deserializes it from XML to a list of accounts object.
        /// </summary>
        /// <returns>List of account objects</returns>
        static public async Task <List <Account> > LoadAccountList()
        {
            try
            {
                StorageFile accountsFile = await ApplicationData.Current.LocalFolder.GetFileAsync(USER_LIST_FILE_NAME);

                string accountsXml = await Windows.Storage.FileIO.ReadTextAsync(accountsFile);

                List <Account> listAccount = AccountsHelper.DeserializeXmlToAccountList(accountsXml);
                listAccount.Add(new Account()
                {
                    head = "Assets/head_add.png", Name = ResourceManagerHelper.ReadValue("addusertip"), isAdd = true
                });
                return(listAccount);
            }
            catch (FileNotFoundException e)
            {
                List <Account> emptyAccountList = new List <Account>();
                return(emptyAccountList);
            }
        }
Ejemplo n.º 4
0
        private void bill_Tapped(object sender, TappedRoutedEventArgs e)
        {
            string tag     = (sender as TextBlock).Tag.ToString();
            string account = string.Empty;
            string parm    = string.Empty;

            if (tag == "1")
            {
                account = ResourceManagerHelper.ReadValue("AccountType1") + "  6235 2897 3123 0982";
            }
            else if (tag == "2")
            {
                account = ResourceManagerHelper.ReadValue("AccountType2") + "  6225 9677 4020 8749";
            }
            else
            {
                account = ResourceManagerHelper.ReadValue("AccountType3") + "  6532 7282 0980 1097";
            }
            this.activeAccount.accountNO = account;
            this.Frame.Navigate(typeof(BillQuery), this.activeAccount);
        }