Skip to content

Commit

Permalink
Demonstration of custom plugin implementation loading in Android project
Browse files Browse the repository at this point in the history
  • Loading branch information
Seifer committed Apr 11, 2016
1 parent 6da4113 commit 403a2f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Expand Up @@ -3,7 +3,8 @@
namespace ValueConversion.UI.Droid.Bootstrap
{
public class ColorPluginBootstrap
: MvxPluginBootstrapAction<MvvmCross.Plugins.Color.PluginLoader>
//: MvxPluginBootstrapAction<MvvmCross.Plugins.Color.PluginLoader>
: MvxLoaderPluginBootstrapAction<MvvmCross.Plugins.Color.PluginLoader, SomeAbsolutelty.Unconventional.Namespace.CustomColorPlugin>
{
}
}
27 changes: 27 additions & 0 deletions ValueConversion/ValueConversion.Droid/CustomColorPlugin.cs
@@ -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();
}
}
}

Expand Up @@ -106,6 +106,7 @@
<Compile Include="Views\VisibilityView.cs" />
<Compile Include="Bootstrap\ColorPluginBootstrap.cs" />
<Compile Include="Bootstrap\VisibilityPluginBootstrap.cs" />
<Compile Include="CustomColorPlugin.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
Expand Down

0 comments on commit 403a2f9

Please sign in to comment.