Skip to content

Instantly share code, notes, and snippets.

@vjdw
vjdw / MainWindow.xaml.cs
Created December 13, 2022 22:41
C# / .NET / WPF / code to attach to WindowOpenedEvent and maximize new windows
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Automation;
namespace AutoMaximize
{
/// <summary>
/// Interaction logic for MainWindow.xaml
@vjdw
vjdw / VirtualList.razor
Created August 17, 2019 20:34
ASP.NET Core Blazor VirtualList
@typeparam TItem
@inject IJSRuntime JSRuntime
<div @ref="scrollContainer" @ref:suppressField style="height: 300px; position: relative; overflow: auto;" @onscroll="HandleScroll">
<div style="height: @(rowHeight*Items.Count())px; width: 1px; position: absolute; top: 0; left: 0;"></div>
@foreach (var virtualRow in VirtualRows)
{
<div style="height: 150px; width: 30px; background-color: gray; position: absolute; top: @(virtualRow.Top)px; left: 0;">@RowTemplate(virtualRow.Item)</div>
}

Keybase proof

I hereby claim:

  • I am vjdw on github.
  • I am vw (https://keybase.io/vw) on keybase.
  • I have a public key whose fingerprint is 0C42 F51C CC88 9BF6 D6BD 9494 C224 3CEB C80E 63CD

To claim this, I am signing this object: