Codemaid
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user