Add project files.

This commit is contained in:
dan_c
2024-01-04 17:32:36 +00:00
parent 6358cf9567
commit da8af59391
48 changed files with 1710 additions and 0 deletions
@@ -0,0 +1,21 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Hyperbar.Desktop;
public class TemplateGeneratorControl :
ContentControl
{
public TemplateGeneratorControl()
{
DataContextChanged += OnDataContextChanged;
}
private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if (DataContext is ITemplatedViewModel templatedViewModel)
{
Content = templatedViewModel.TemplateFactory.Create(DataContext.GetType().Name);
}
}
}