@page "/table/auto-refresh"
@inject IStringLocalizer<NavMenu> NavMenuLocalizer
@inject IStringLocalizer<Tables> BaseLocalizer
@inject IStringLocalizer<TablesAutoRefresh> Localizer
@inject IStringLocalizer<Foo> LocalizerFoo

<h3>@BaseLocalizer["TableBaseTitle"] - @NavMenuLocalizer["TableAutoRefresh"]</h3>
<h4>@Localizer["TablesAutoRefreshDescription"]</h4>

<DemoBlock Title="@Localizer["TablesAutoRefreshNormalTitle"]"
           Introduction="@Localizer["TablesAutoRefreshNormalIntro"]"
           Name="TablesAutoRefreshNormal">
    <section ignore>
        <p>@((MarkupString)Localizer["TablesAutoRefreshNormalTips1"].Value)</p>
        <p>@((MarkupString)Localizer["TablesAutoRefreshNormalTips2"].Value)</p>
    </section>
    <Table TItem="Foo"
           IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
           IsStriped="true" IsBordered="true" IsMultipleSelect="true"
           IsAutoRefresh="true" AutoRefreshInterval="2000"
           OnQueryAsync="@OnAutoQueryAsync">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="180" />
            <TableColumn @bind-Field="@context.Name" Width="100" />
            <TableColumn @bind-Field="@context.Address" />
            <TableColumn @bind-Field="@context.Count" />
            <TableColumn @bind-Field="@context.Complete" />
        </TableColumns>
    </Table>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesAutoRefreshControlTitle"]"
           Introduction="@Localizer["TablesAutoRefreshControlIntro"]"
           Name="TablesAutoRefreshControl">
    <section ignore>
        <p>@Localizer["TablesAutoRefreshControlDescription"]</p>
        <Button Text="@Localizer["TablesAutoRefreshControlToggleAuto"]" OnClick="@ToggleAuto" /> <span><code>IsAutoRefresh</code> @Localizer["TablesAutoRefreshControlIsAutoRefresh"]：<code>@IsAutoRefresh</code></span>
    </section>
    <Table TItem="Foo"
           IsPagination="true" PageItemsSource="@(new int[] { 2, 4 })"
           IsStriped="true" IsBordered="true" IsMultipleSelect="true"
           IsAutoRefresh="@IsAutoRefresh" AutoRefreshInterval="2000"
           OnQueryAsync="@OnManualQueryAsync">
        <TableColumns>
            <TableColumn @bind-Field="@context.DateTime" Width="180" />
            <TableColumn @bind-Field="@context.Name" Width="100" />
            <TableColumn @bind-Field="@context.Address" />
            <TableColumn @bind-Field="@context.Count" />
            <TableColumn @bind-Field="@context.Complete" />
        </TableColumns>
    </Table>
</DemoBlock>
