Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Windows;
public static class ItemsControl
{
public static readonly DependencyProperty EnumSourceProperty = DependencyProperty.RegisterAttached(
"EnumSource",
typeof(Type),
typeof(ItemsControl),
new PropertyMetadata(default(Type), PropertyChangedCallback));
Assert.AreEqual($END$); // Name this ae
using System;
using System.Windows;
using System.Windows.Data;
public class DependencyPropertyListener : DependencyObject
{
private static readonly Guid Default = new Guid(); // Want a signal if null
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source",
public static class Automation
{
public static void SimulateClick(this CheckBox checkBox)
{
checkBox.RaiseMouseButton(UIElement.PreviewMouseLeftButtonDownEvent, MouseButton.Left, 1)
.RaiseMouseButton(Mouse.PreviewMouseDownEvent, MouseButton.Left, 1)
.RaiseKeyboardFocusEvent(Keyboard.PreviewGotKeyboardFocusEvent)// old: System.Windows.Controls.TextBox new: System.Windows.Controls.CheckBox Content: IsChecked:False
// .SetProp(UIElement.IsKeyboardFocusWithinProperty, True)
// .SetProp(UIElement.IsKeyboardFocusedProperty, True)
.RaiseRoutedEvent(FocusManager.GotFocusEvent)
Remove Copyable icopyable & idirty
Undocache notifying on dirty
Cache + diff
Test that inpc signals for all props for class
Reset undo for textbox/updowns on undo/save
<Grid TextBlock.FontSize="23">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
[Test, Explicit]
public void ParseChm()
{
foreach (var file in Directory.EnumerateFiles(@"C:\Git\ComApiExplorer\Apis\decompile\HTML"))
{
if (System.IO.Path.GetExtension(file) != ".htm")
{
continue;
}
var document = new HtmlAgilityPack.HtmlDocument();
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
using System.Collections;
using System.Collections.Specialized;
using System.Windows;
using System.Windows.Controls;
public static class ListBoxExt
{
public static readonly DependencyProperty SelectedItemsBindableProperty = DependencyProperty.RegisterAttached(
"SelectedItemsBindable",
typeof(IList),
internal class TokenReader
{
private readonly Token[] _tokens;
private readonly int _startAt;
public TokenReader(Token[] tokens, int startAt)
{
_tokens = tokens;
_startAt = startAt;
}
public int Index { get; private set; }