示例#1
0
 protected override async Task OnAfterRenderAsync(bool firstRender)
 {
     if (firstRender)
     {
         await MediaQueryList.Initialize(this);
     }
 }
 public async ValueTask DisposeAsync()
 {
     if (MediaQueryList == null)
     {
         return;
     }
     await MediaQueryList.RemoveQuery(this);
 }
示例#3
0
 protected override void OnInitialized()
 {
     if (MediaQueryList == null)
     {
         throw new Exception("MediaQueryList is null. The MediaQueryList component should be added to the root or MainLayout of your applicaiton.");
     }
     else
     {
         MediaQueryList.AddQuery(this);
     }
 }
示例#4
0
 public void Dispose()
 {
     MediaQueryList.RemoveQuery(this);
 }
示例#5
0
 public async ValueTask DisposeAsync()
 {
     await MediaQueryList.RemoveQuery(this);
 }