Account.razor.cs 831 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Threading.Tasks;
  3. using Microsoft.AspNetCore.Components;
  4. using Microsoft.AspNetCore.Components.Authorization;
  5. using Microsoft.AspNetCore.Identity;
  6. using HyperCube.Models;
  7. namespace HyperCube.Pages
  8. {
  9. public partial class Account
  10. {
  11. [Inject]
  12. public AuthenticationStateProvider AuthenticationStateProvider { get; set; }
  13. [Inject]
  14. public UserManager<IdentityUser> UserManager { get; set; }
  15. [Inject]
  16. AppData AppData { get; set; }
  17. private AccountModel account = new();
  18. string myBalance = "";
  19. protected override async Task OnInitializedAsync()
  20. {
  21. account = AppData.CurrentAccount;
  22. if (Blockchain.GetMain() != null)
  23. myBalance = await account.GetBalance();
  24. }
  25. }
  26. }