Skip to content

Commit

Permalink
Updating viewmodel creation code gen
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrandolph committed Oct 12, 2020
1 parent 05a2bc9 commit ffe29fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BuildIt.Navigation.Generator/PageViewModelGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void OnVisitSyntaxNode(SyntaxNode syntaxNode)

if (syntaxNode is ClassDeclarationSyntax classDeclarationSyntax)
{
var classAttribute = classDeclarationSyntax.AttributeLists.FirstOrDefault()?.Attributes.FirstOrDefault(attrib => (attrib.Name as IdentifierNameSyntax)?.Identifier.Text + "Attribute" == typeof(ApplicationAttribute).Name);
var classAttribute = classDeclarationSyntax.AttributeLists.FirstOrDefault()?.Attributes.FirstOrDefault(attrib => (attrib.Name as IdentifierNameSyntax)?.Identifier.Text + "Attribute" == typeof(ViewModelMappingRegisterAttribute).Name);
var viewModelClassAttribute = classDeclarationSyntax.AttributeLists.FirstOrDefault()?.Attributes.FirstOrDefault(attrib => (attrib.Name as IdentifierNameSyntax)?.Identifier.Text + "Attribute" == typeof(ViewModelAttribute).Name);
if (classAttribute != null)
{
Expand Down
4 changes: 2 additions & 2 deletions BuildIt.Navigation/EventMessageAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public ApplicationServiceAttribute(string registrationMethod)
}

[AttributeUsage(AttributeTargets.Class)]
public class ApplicationAttribute : Attribute
public class ViewModelMappingRegisterAttribute : Attribute
{
public string RegistrationMappingMethod { get; }

public ApplicationAttribute(string registrationMethod)
public ViewModelMappingRegisterAttribute(string registrationMethod)
{
RegistrationMappingMethod = registrationMethod;
}
Expand Down
2 changes: 1 addition & 1 deletion MvvmNavigation.UI/UIMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MvvmNavigation.UI
{
[Application(nameof(RegistarViewModelMappings))]
[ViewModelMappingRegister(nameof(RegistarViewModelMappings))]

public partial class UIMapping
{
Expand Down
5 changes: 1 addition & 4 deletions MvvmNavigation/MvvmNavigation.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using BuildIt.Navigation;
using BuildIt.Navigation.Messages;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using MvvmNavigation.Messages;
using MvvmNavigation.UI;
using MvvmNavigation.ViewModels;
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
Expand All @@ -14,7 +11,7 @@

namespace MvvmNavigation
{
[Application(nameof(RegistarViewModelMappings))]
[ViewModelMappingRegister(nameof(RegistarViewModelMappings))]
sealed partial class App : Application, INavigationApplication
{
/// <summary>
Expand Down

0 comments on commit ffe29fe

Please sign in to comment.