private void Init()
        {
            _viewModel = new WalletPageViewModel();
            _viewModel.NetworkSwitchEvt     += NetworkSwitch;
            _viewModel.RefreshBlockChainEvt += RefreshBlockChain;
            DataContext = _viewModel;
            var walletInformationTab = new TabItem
            {
                Header  = "Wallet",
                Content = _walletInformation
            };
            var blocksTab = new TabItem
            {
                Header  = "Blocks",
                Content = _blockChainInformation
            };
            var memoryPoolTab = new TabItem
            {
                Header  = "Memory POOL",
                Content = _memoryPoolInformation
            };
            var smartContractTab = new TabItem
            {
                Header  = "Smart contract",
                Content = _smartContractPage
            };

            this.tabControl.Items.Add(walletInformationTab);
            this.tabControl.Items.Add(blocksTab);
            this.tabControl.Items.Add(memoryPoolTab);
            this.tabControl.Items.Add(smartContractTab);
        }
 private void Destroy()
 {
     Disconnect();
     _viewModel.NetworkSwitchEvt     -= NetworkSwitch;
     _viewModel.RefreshBlockChainEvt -= RefreshBlockChain;
     _viewModel = null;
     this.tabControl.Items.Clear();
 }
示例#3
0
        public async Task <IActionResult> Wallet()
        {
            AuthDTO auth = GetAuth(_ESIClient);

            _Log.LogDebug(String.Format("Logged in to retrieve Character Info for Character Id: {0}", auth.CharacterId));

            List <CharacterWalletJournal> walletJournalEntries = new List <CharacterWalletJournal>();
            // TODO: THE BELOW IS UNFORTUNATELY F*****G BROKEN

            /*
             * var walletJournalApi = await _ESIClient.Wallet.GetCharacterWalletJournalV4Async(auth, 1);
             * walletJournalEntries = walletJournalApi.Model;
             * if (walletJournalApi.MaxPages > 1)
             * {
             *  for (int x = 2; x < walletJournalApi.MaxPages; x++)
             *  {
             *      walletJournalApi = await _ESIClient.Wallet.GetCharacterWalletJournalV4Async(auth, x);
             *      walletJournalEntries.AddRange(walletJournalApi.Model);
             *  }
             * }
             */

            List <WalletTransaction> walletTransactions = new List <WalletTransaction>();
            var walletTransactionsApi = await _ESIClient.Wallet.GetCharacterWalletTransactionsV1Async(auth, 0);

            walletTransactions = walletTransactionsApi.Model;
            if (walletTransactionsApi.MaxPages > 1)
            {
                for (int x = 2; x < walletTransactionsApi.MaxPages; x++)
                {
                    walletTransactionsApi = await _ESIClient.Wallet.GetCharacterWalletTransactionsV1Async(auth, x);

                    walletTransactions.AddRange(walletTransactionsApi.Model);
                }
            }

            var model = new WalletPageViewModel()
            {
                Journal      = walletJournalEntries,
                Transactions = walletTransactions
            };

            return(View(model));
        }
示例#4
0
        public WalletPage()
        {
            resources = ResourceLoader.GetForCurrentView();
            InitializeComponent();
            viewModel = new WalletPageViewModel(new BankAccountInfoService(), new TransactionService(), new CategoryService(), new WalletCategoryService(), new WalletBankService(), new CurrencyService(), ResourceLoader.GetForCurrentView())
            {
                BeforeSync = () =>
                {
                    IconRotation.Begin();
                    TransactionsAccordion.UnselectAll();
                },
                AfterSync = () =>
                {
                    IconRotation.Stop();
                    RecalculateLineGraphInterval();
                    SetStyles();
                }
            };
            DataContext = viewModel;

            TimeRangeComboboxCat.ItemsSource   = Enum.GetValues(typeof(TimeRange)).Cast <TimeRange>();
            TimeRangeComboboxTrans.ItemsSource = Enum.GetValues(typeof(TimeRange)).Cast <TimeRange>();
        }