コード例 #1
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!isbacknav)
            {
                int people = 0;
                peopleCollection = new ObservableCollection<Person>();
                settings.TryGetValue<int>("people", out people);

                //if (people < 0)
                //{
                //    for (int i = peopleCollection.Count - 1; i > peopleCollection.Count - 1 + people; i--)
                //    {
                //        peopleCollection.RemoveAt(i);
                //    }

                for (int i = 0, j = people; i < j; i++)
                {
                    MetroFlowData data = new MetroFlowData();
                    if (i == 0)
                    {
                        data.Title = "Tap To Rename";
                    }
                    else
                        data.Title = (i + 1) + "";

                    metroFlow1.Items.Add(data);
                    peopleCollection.Add(new Person());
                    party.People = peopleCollection;

                }
            }

            

        }
コード例 #2
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            settings.TryGetValue<Party>("party", out party);
            for (int i = 0, j = party.People.Count; i < j; i++)
            {
                MetroFlowData data = new MetroFlowData();
                if (party.People[i].Name == null || party.People[i].Name == "")
                    data.Title = (i + 1) + "";
                else
                    data.Title = party.People[i].Name;
                metroFlow1.Items.Add(data);
            }

            subBox.Text = String.Format("{0:C}", party.People[0].Total);
            tipBox.Text = String.Format("{0:C}", party.People[0].Total * party.TipRate);
            taxBox.Text = String.Format("{0:C}", party.People[0].Total * party.TaxRate);
            totalBox.Text = String.Format("{0:C}", party.People[0].Total + party.People[0].Total * party.TaxRate + party.People[0].Total * party.TipRate);


        }