restructure project for part 2

This commit is contained in:
TheXamlGuy
2024-01-27 10:55:53 +00:00
parent a322893166
commit 48925b89ff
96 changed files with 383 additions and 351 deletions
@@ -0,0 +1,25 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Hyperbar.UI.Windows;
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);
}
else
{
}
}
}