-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sylac/develop
Develop
- Loading branch information
Showing
32 changed files
with
188 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Sylac.Mvvm.Abstraction; | ||
|
||
public interface IViewModel | ||
{ | ||
/// <summary> | ||
/// Called when the navigation to the view model is initiated. | ||
/// </summary> | ||
void OnNavigatingTo(); | ||
|
||
/// <summary> | ||
/// Called when the navigation from the view model is initiated. | ||
/// </summary> | ||
void OnNavigatingFrom(); | ||
|
||
/// <summary> | ||
/// Called when the navigation to the view model is completed. | ||
/// </summary> | ||
void OnNavigatedTo(); | ||
|
||
/// <summary> | ||
/// Called when the navigation from the view model is completed. | ||
/// </summary> | ||
void OnNavigatedFrom(); | ||
} | ||
|
||
public interface IViewModel<out TParam> : IViewModel | ||
where TParam : IViewModelParameters | ||
{ | ||
/// <summary> | ||
/// Initializes the view model with the provided parameters. | ||
/// </summary> | ||
/// <param name="parameter"> The parameters to initialize the view model with. </param> | ||
void Initialize(IViewModelParameters parameter); | ||
} |
2 changes: 1 addition & 1 deletion
2
Sylac.Mvvm.Core/IViewModelParameters.cs → ....Core/Abstraction/IViewModelParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Sylac.Mvvm; | ||
namespace Sylac.Mvvm.Abstraction; | ||
|
||
public interface IViewModelParameters; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
Sylac.Mvvm.Core/Navigation/ConnectWithViewModelAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
namespace Sylac.Mvvm.Navigation | ||
{ | ||
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
public sealed class ConnectWithViewModelAttribute<TViewModel, TParams>() : Attribute | ||
using Sylac.Mvvm.Abstraction; | ||
|
||
namespace Sylac.Mvvm.Navigation; | ||
|
||
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
public sealed class ConnectWithViewModelAttribute<TViewModel, TParams>() : Attribute | ||
where TViewModel : IViewModel<TParams> | ||
where TParams : IViewModelParameters | ||
{ | ||
} | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.