Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demonstration of custom plugin implementation loading in Android project
- Loading branch information
Seifer
committed
Apr 11, 2016
1 parent
6da4113
commit 403a2f9
Showing
3 changed files
with
30 additions
and
1 deletion.
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
27 changes: 27 additions & 0 deletions
27
ValueConversion/ValueConversion.Droid/CustomColorPlugin.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using MvvmCross.Platform; | ||
using MvvmCross.Platform.UI; | ||
using MvvmCross.Platform.Plugins; | ||
using MvvmCross.Plugins.Color.Droid; | ||
using MvvmCross.Binding.Bindings.Target.Construction; | ||
using MvvmCross.Plugins.Color.Droid.BindingTargets; | ||
|
||
namespace SomeAbsolutelty.Unconventional.Namespace | ||
{ | ||
public class CustomColorPlugin: IMvxPlugin | ||
{ | ||
public void Load() | ||
{ | ||
Console.WriteLine ("-------- This plugin is loaded instead of the default"); | ||
Mvx.RegisterSingleton<IMvxNativeColor>(new MvxAndroidColor()); | ||
Mvx.CallbackWhenRegistered<IMvxTargetBindingFactoryRegistry>(RegisterDefaultBindings); | ||
} | ||
|
||
private void RegisterDefaultBindings() | ||
{ | ||
var helper = new MvxDefaultColorBindingSet(); | ||
helper.RegisterBindings(); | ||
} | ||
} | ||
} | ||
|
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