Add project files.

This commit is contained in:
Daniel Clark
2022-11-01 15:26:08 +00:00
parent daa7b59f22
commit 7e4f880821
408 changed files with 16863 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace TheXamlGuy.UI.WPF;
public class TemplateGeneratorControl : ContentControl
{
internal static readonly DependencyProperty FactoryProperty =
DependencyProperty.Register("Factory", typeof(Func<object>),
typeof(TemplateGeneratorControl), new PropertyMetadata(null, OnFactoryPropertyChanged));
private static void OnFactoryPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
{
if (dependencyObject is TemplateGeneratorControl sender && args.NewValue is not null)
{
Func<object> factory = (Func<object>)args.NewValue;
sender.Content = factory();
}
}
}