Exemplo n.º 1
0
        public void init(sendTransaction onSendTx, Blockchain chain)
        {
            _chain = chain;
            if (_init)
            {
                return;
            }
            _init   = true;
            sendTx += onSendTx;
            if (File.Exists(".contacts"))
            {
                contacts = JsonConvert.DeserializeObject <List <Contact> >(File.ReadAllText(".contacts"));
            }
            else
            {
                contacts = new List <Contact>();
            }

            foreach (var x in contacts)
            {
                x.balance = chain.count_funds(x.pubToken);
                ContactItem item = new ContactItem(x.pubToken, x.name, x.balance, OpenSendDialogue);
                item.Margin = new Thickness(20);
                contactList.Children.Add(item);
            }

            Button b = new Button();

            b.Content  = "Add contact";
            b.FontSize = 30;
            b.Click   += onAddContact;
            b.Margin   = new Thickness(30);
            contactList.Children.Add(b);
        }
Exemplo n.º 2
0
 public ContactPage(sendTransaction onSendTx, Blockchain chain, AccountView v)
 {
     init(onSendTx, chain);
     cur = v;
 }