This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//main | |
<MudPaper Class="mt-4" Height="400px" Style="overflow:hidden; position:relative;"> | |
<MudDrawerContainer Class="mud-height-full"> | |
<MudDrawer @bind-Open="@open" Fixed="true" DisableOverlay="true" Elevation="1" Variant="@DrawerVariant.Mini"> | |
<NavMenu DrawerOpen="open" /> | |
</MudDrawer> | |
<div class="d-flex justify-center align-center mud-height-full"> | |
<MudButton OnClick="@ToggleDrawer" Color="Color.Primary">Toggle</MudButton> | |
</div> | |
</MudDrawerContainer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetString(object t, string property) | |
{ | |
var language = CultureInfo.CurrentCulture.ToString(); | |
if (language is not null and not "en") | |
{ | |
foreach (var p in t.GetType().GetProperties().Where(p => p.Name.ToLower().Contains(property.ToLower() + language) && !string.IsNullOrWhiteSpace((string)p.GetValue(t)))) | |
{ | |
return (string)p.GetValue(t); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inject IDialogService DialogService | |
<MudText Class="mt-1">This test page shows a 'bug' in Mud expansion panels...</MudText> | |
<MudText Class="mt-1">Click the add panels button (once). Several panels are created. Then, click on the top panel's pushpin to delete it. Once deleted, the panel below it auto-expands. This is <strong>undesired</strong> behaviour. </MudText> | |
<MudText Class="mt-1">Note: if you delete panels from bottom up, no panel get expanded. It appears only the panel directly below the delted on expands.</MudText> | |
<MudButton @onclick="AddPanels" Variant="Variant.Filled" Color="Color.Primary"> | |
Add Panels | |
</MudButton> | |
<MudExpansionPanels> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
'data source=' + @@servername + | |
';initial catalog=' + db_name() + | |
case type_desc | |
when 'WINDOWS_LOGIN' | |
then ';trusted_connection=true' | |
else | |
';user id=' + suser_name() | |
end | |
from sys.server_principals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Components; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Localization; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
public partial class LocationTable : ComponentBase | |
{ | |
[Inject] private DataManager<Area, ApplicationDbContext> AreaManager { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CascadingParameter] private Task<AuthenticationState> AuthSP { get; set; } | |
[Inject] private NavigationManager NavigationManager { get; set; } | |
string UserId; | |
ApplicationUser CurrentUser = new(); | |
private async Task RedirectToLogin() | |
{ | |
var user = (await AuthSP).User; | |
if (!user.Identity.IsAuthenticated) | |
{ | |
NavigationManager.NavigateTo("Identity/Account/Login", true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MudTextField @ref="field" | |
@bind-Value="_searchValue" | |
KeyUpPreventDefault="true" | |
OnKeyUp="OnKeyUp"/> | |
@code { | |
private string _searchValue = string.Empty; | |
MudTextField<string> field; | |
private void OnKeyUp(KeyboardEventArgs args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationUser : IdentityUser | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
[NotMapped] | |
public string FullName => $"{LastName}, {FirstName}"; | |
public DateTime? DateOfBirth { get; set; } = DateTime.Now; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (areas==null) | |
{ | |
<p>wait</p> | |
} | |
else | |
{ | |
<MudTable Items="@locations" T="AreaPlace" Dense="true" @bind-SelectedItem="selectedItem1" Filter="new Func<AreaPlace,bool>(FilterFunc1)"> | |
<ToolBarContent> | |
<MudItem xs="12" md="5"> |
NewerOlder