Reformatted and cleaned up code across whole project.
This commit is contained in:
1 parent
42a7871ed4
commit
99cb9268dd
25 files changed
+272
-319
No files matched your search
@@ -5,23 +5,19 @@ using PcgsInvUi.ViewModels;
|
||||
|
||||
namespace PcgsInvUi;
|
||||
|
||||
public class ViewLocator : IDataTemplate
|
||||
{
|
||||
public Control Build(object data)
|
||||
{
|
||||
public class ViewLocator : IDataTemplate {
|
||||
public Control Build(object data) {
|
||||
var name = data.GetType().FullName!.Replace("ViewModel", "View");
|
||||
var type = Type.GetType(name);
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
if (type != null) {
|
||||
return (Control)Activator.CreateInstance(type)!;
|
||||
}
|
||||
|
||||
|
||||
return new TextBlock { Text = "Not Found: " + name };
|
||||
}
|
||||
|
||||
public bool Match(object data)
|
||||
{
|
||||
public bool Match(object data) {
|
||||
return data is ViewModelBase;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user