Skip to content

Instantly share code, notes, and snippets.

View EdCharbeneau's full-sized avatar
🏠
Working from home

Ed Charbeneau EdCharbeneau

🏠
Working from home
View GitHub Profile
@EdCharbeneau
EdCharbeneau / Templates.cshtml
Last active February 25, 2019 22:19
Row Template Detail
@page "/grid/templates"
@using TelerikBlazor.App.Models
@inject NorthwindContext nwContext
<h4> Row Template </h4>
<KendoGrid Data=@GridData Height="@Height">
<RowTemplate Context="product">
@if (selectedId == product.ProductId)
@EdCharbeneau
EdCharbeneau / BuilderUsage.cshtml
Last active February 19, 2019 01:54
Css Builder Extensions
<li aria-selected=@IsActive role="tab" class="@ClassToRender">
...
</li>
@functions {
...
protected bool IsActive => ContainerTabSet.ActiveTab == this;
[Parameter] protected bool Disabled { get; set; }
[Parameter] protected string Class { get; set; }
@EdCharbeneau
EdCharbeneau / CamelCase.cs
Last active February 10, 2019 17:46
CamelCase to human readable
public static string SplitUpperCaseToString(this string source) {
return string.Join(" ", SplitUpperCase(source));
}
public static string[] SplitUpperCase(this string source) {
if (source == null) {
return new string[] {}; //Return empty array.
}
if (source.Length == 0) {
return new string[] {""};
Microsoft Visual Studio Enterprise 2019 Preview
Version 16.0.0 Preview 2.2
VisualStudio.16.Preview/16.0.0-pre.2.2+28602.52
Microsoft .NET Framework
Version 4.7.03056
Installed Version: Enterprise
Application Insights Tools for Visual Studio Package 9.0.11128.2
Application Insights Tools for Visual Studio
@EdCharbeneau
EdCharbeneau / index.cshtml
Created January 25, 2019 23:15
Telerik UI for Blazor Grid Demo
@page "/"
<KendoGrid Data=@Orders Pageable=true Sortable=true>
<KendoGridColumn Field=@nameof(OrderViewModel.OrderID)>
<Template>
@{
var item = context as OrderViewModel;
<KendoButton OnButtonClick=@(()=> HandleDelete(item))>Delete</KendoButton>
}
</Template>
@EdCharbeneau
EdCharbeneau / OrderViewModel.cs
Last active January 24, 2019 20:46
Quick C# data for testing
@functions {
public class OrderViewModel
{
public int OrderID { get; set; }
public decimal? Freight { get; set; }
public DateTime? OrderDate { get; set; }
public string ShipCity { get; set; }
@EdCharbeneau
EdCharbeneau / index.html
Last active January 25, 2019 23:23
Kendo CSS for Libman
<!-- Choose one below -->
<!-- <link href="css/kendo-default/dist/all.css" rel="stylesheet" />
<link href="css/kendo-material/dist/all.css" rel="stylesheet" /> -->
<link href="css/kendo-bootstrap/dist/all.css" rel="stylesheet" />
@EdCharbeneau
EdCharbeneau / ThemeManager.cshtml
Last active January 16, 2019 22:29
Kendo UI css dependencies
<select onchange=@HandleThemeChange>
@foreach (var t in themes)
{
<option value=@t>@t</option>
}
</select>
@functions {
string[] themes = { "Default", "Bootstrap", "Material" };
@EdCharbeneau
EdCharbeneau / MyProject.csproj
Last active December 4, 2018 22:14
Compile scss with dotnet CLI
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="css\" />
<Folder Include="wwwroot\" />
</ItemGroup>
@EdCharbeneau
EdCharbeneau / Startup.cs
Created October 12, 2018 21:28
InMemoryDB Seeding from Startup.cs
using Microsoft.AspNetCore.Blazor.Server;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Serialization;
using StateHasChanged4.Server.Models;
using System.Linq;
using System.Net.Mime;
using Microsoft.EntityFrameworkCore;