This commit is contained in:
TheXamlGuy
2024-01-06 14:34:25 +00:00
parent 53537aa4c7
commit e1c7846e45
73 changed files with 251 additions and 198 deletions
@@ -2,7 +2,6 @@
namespace Hyperbar.Windows
{
public interface ITemplateGeneratorFactory
{
DataTemplate Create();
@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Hyperbar.Windows;
public class TemplateGeneratorControl :
public class TemplateGeneratorControl :
ContentControl
{
public TemplateGeneratorControl()
@@ -18,4 +18,4 @@ public class TemplateGeneratorControl :
Content = templatedViewModel.TemplateFactory.Create(DataContext.GetType().Name);
}
}
}
}
@@ -3,17 +3,17 @@ using Microsoft.UI.Xaml.Markup;
namespace Hyperbar.Windows;
public class TemplateGeneratorFactory :
public class TemplateGeneratorFactory :
ITemplateGeneratorFactory
{
public DataTemplate Create()
{
string xamlString = @"
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:desktop='using:Hyperbar.Windows'>
<desktop:TemplateGeneratorControl />
</DataTemplate>";
return (DataTemplate)XamlReader.Load(xamlString);
}
}
}