This commit is contained in:
Pranav K 2019-09-12 14:23:39 -07:00
parent ba094b6ccb
commit f0c6fca60f
No known key found for this signature in database
GPG Key ID: 1963DA6D96C3057A
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,9 @@
namespace BlazingPizza.Server
{
public class Point
{
public double X { get; set; }
public double Y { get; set; }
}
}

View File

@ -0,0 +1,33 @@
@page "/orderstatus"
@using System.Threading
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime
@implements IDisposable
<div id="status" data-loc="@locString">Your order is on it's way. Here is it's current location: (@locX, @locY)</div>
@functions {
private int locX;
private int locY;
private Random random = new Random();
private Timer timer;
private string locString;
protected override void OnInitialized()
{
timer = new Timer(_ =>
{
locX = random.Next(1000);
locY = random.Next(1000);
locString = $"{locX},{locY}";
InvokeAsync(() => StateHasChanged());
}, default, TimeSpan.Zero, TimeSpan.FromSeconds(2));
}
public void Dispose()
{
timer.Dispose();
}
}

View File

@ -1,4 +1,4 @@
## Blazor benchamrks
## Blazor benchmarks
These projects assist in Benchmarking Components.
See https://github.com/aspnet/Benchmarks#benchmarks for usage guidance on using the Benchmarking tool with your application