Coder Social home page Coder Social logo

cheesebaron.mvxplugins's Introduction

MvxPlugins

Build Status

Plugin NuGet version
Settings NuGet
DeviceInfo NuGet
Connectivity NuGet
SMS NuGet
SimpleWebToken NuGet

This repository is a collection of plugins for MvvmCross. Currently it consists of the following plugins:

  • DeviceInfo A plugin for getting information about your device, such as screen dimensions, device id, firmware version, memory, type and more.
  • Connectivity A plugin for getting network information and status. aritchie's plugin is a great alternative to this plugin.
  • Settings A plugin for saving simple key/value kind of settings into persistant storage
  • SimpleWebToken A plugin to create SimpleWebToken's from raw representations and to generate your own.
  • SMS A simple task to send SMS using default/install SMS applications on device.
  • More to come! If you have a good idea, feel free to pitch it with me.

Thanks to

Supported Platforms

Plugin/Platform Android iOS UWP WPF
Settings x x x x
Connectivity x x x
Device Info x x x
SMS x x x
SimpleWebToken x x x x

Contributors

Major contributors will be listed below.

Documentation

For the moment look at the samples. More detailed docs will come in the Wiki (when someone adds it).

Other MvvmCross plugins

Other people are doing MvvmCross plugins as well and I think it is great to mention them, as they might have a useful plugin for your MvvmCross project.

Dev Plugin
Kerry Street Street.MvxPlugins
James Montemagno for ceton Mvx.Plugins.Settings
Geoffrey Huntley Ghuntley.MvxPlugins.FaceTime
Artur Rybak IHS.MvvmCross.Plugins.Keychain
Allan Ritchie acrmvvmcross
SeeD-Seifer Mvx.Geocoder
ChristianRuiz MvvmCross-SecureStorage
ChristianRuiz MvvmCross-ControlsNavigation

License

cheesebaron.mvxplugins's People

Contributors

attilah avatar cheesebaron avatar dependabot-preview[bot] avatar dependabot[bot] avatar ghuntley avatar hlogmans avatar marcoscobena avatar modplug avatar npadrutt avatar slodge avatar turibbio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cheesebaron.mvxplugins's Issues

TODO: don't lie about methods being async

Some code is returning a Task and simply wrapping the contents into Task.Run(() => {});. This is basically lying about something being async when not.

This is needed to be fixed. Might break the API some places.

So far I've seen it in

  • Connectivity

Cheesebaron.MvxPlugins-master/Samples/FormsPresenters Upgrade or Fork VS2015RC

I have been working with the very latest stable releases and Visual Studio 2015. VS went RC late April and I expect the final release to be out by the end of July. Prior to the RC, there was no Xamarin Support for Windows Phone 8.1 only Windows Phone 8.0 via Siliverlight 8.0. With the release of the RC we now have support for WP 8.1 via Silverlight 8.1 and support for WP 8.0 has been dropped.

Somewhat inconvenient I know, it means you need to retool for WP 8.1 but WP currently has low market share!

Microsoft created a new PCL Profile for Shared Projects that includes WP 8.1 as well as Windows 8.1. At some stage I might add the ViewPresenter for Windows 8.1, but there is a much more interesting Windows 10 Universal App coming with Windows 10 end of July. This target is slated to run on both Mobile devices and the desktop. I have joined the Xamarin preview group for W10 UAP.

Right now I have taken the Cheesebaron.MvxPlugins-master/Samples/FormsPresenters set and upgraded NeGet packages as well as changing the PCL to the new profile and changed the Windows Phone over to 8.1. The only files touched that are relevant are the packages.config and 3 Movies.*.csproj files. All three phone platforms I have tested and work.

_I can email the zip of these files, 12kb (Fork & pull), or I could get a shared access and push._

We need to be mindful that this change will be somewhat disruptive for developers still on VS 2013. However what I am working on is important as it will provide a set of starter VS Templates for various combinations of components one would like in a Xamarin Universal App and It would help to have a stable set of NuGet Packages including CheesBarron.

Things will get quite hot after the Windows 10 release.

DeviceInfo.WindowsUWP Not actually supporting UWP

The nuspec file for DeviceInfo doesn't actually use the WindowsUWP project for anything.

The ability of a UWP MvvmCross UI application to consume this nuget successfully via Bootstrap.cs class declaration relies on the WindowsCommon lib, not WindowsUWP.

Default constructor not found for type Cheesebaron.MvxPlugins.Connectivity.Touch.Plugin

When in release mode with LinkAll set to true, the app crashes.
Fix the crash in ConnectivityPluginBootstrap.cs by adding Preserve:

/// <summary>
/// Default constructor not found for type Cheesebaron.MvxPlugins.Connectivity.Touch.Plugin
/// </summary>
[Foundation.Preserve(AllMembers = true)]
public class ConnectivityPluginBootstrapLinkerPleaseInclude
{
    public void Include()
    {
        new Cheesebaron.MvxPlugins.Connectivity.Touch.Plugin();
    }
}

Settings plugin: Missing Bootstrap for iOS if added via NuGet

Hello, I did a quick test of Settings plugin - both for Android and iOS. For Android all worked like a charm but after I added Settings plugin to the iOS project it failed. I realised the SettingsPluginBootstrap.cs and its Bootstrap folder are missing. After I created / added those manually the plugin loaded. Everybody will easily find a fix for this but if fixed it will save peoples' time I guess.

Have a great day :)
Jan

PCL support

Hello,

I was just doing the MvvmCross 4.0 update this morning and found that after updating your settings plugin it couldn't be added to my core project as the PCL profile is no longer supported. I am not sure if this is a deliberate change? It is PCL 4.5 - Profile259 using Xamarin Studio on a Mac.

This is the error :
Could not install package 'Cheesebaron.MvxPlugins.Settings 1.2.3'. You are trying to install this package into a project that targets 'portable-net45+win+wpa81+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Cheers,
Ryan

Can not update a value to null

in AddOrUpdateValue, the line:

        var type = value.GetType();

crashes if value is null.
It should be replaced with:

    public bool AddOrUpdateValue<T>(string key, T value = default(T))
    {
        if(string.IsNullOrEmpty(key))
            throw new ArgumentException("Key must have a value", "key");

        var type = typeof(T);

SMS Plugin, strange error

Hi,

I wanted to use the SMS Plugin, but I get a strange warning which prevents my code from compiling:

The primary reference "Cheesebaron.MvxPlugins.SMS" could not be resolved because it was built against the ".NETPortable,Version=v4.5,Profile=Profile78" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.0,Profile=Profile24".

Anyway, my settings seem to be correct.
image

What could be the cause of that?

Regards,
Marcel

xUnit tests

I'd like to have some test suites for the plugins, just to make sure the logic works. Although some of the tests probably would end up as integration tests, it would still be quite valuable.

Update Nuspecs

  • Add PDB and MDB files to all nuspecs
  • Add source to all nuget packages
  • Add missing WindowsCommon projects to nuspecs

Bug in Settings Plugin

With boolean value, suppose any key is saved as false; when using method settings.GetValue with default value of true (my understanding is, it should get the value from file, and only if missing, return default value), it's returning true instead of false.

Basically, it's coming to this area

        if (Equals(default(T), returnVal))
        {
            returnVal = defaultValue;
        }

on debug, I can see returnVal = false, defaultValue = true before it's set to be same.

Bcl on Xamarin Studio (Mac)

Hi!

I tried building the core project but XS keeps complaining that the project references Nuget packages that are missing.

I installed Microsoft.Net.Http etc. but I can see that most LIB folders under packages/Microsoft.Bcl.1.1.6 are empty.

This is with XS 4.2.3 on a Mac. I tried with profile 78 and profile 156.

Sms Plugin built in Debug - Windows Phone

I just did the pre-scan before submitting the new version of my app to the Windows Phone store, and it gave the error "The binary Cheesebaron.MvxPlugins.SMS.dll is built in debug mode."

Apparently, Windows Phone Store will not allow applications to be submitted if one of the dependencies was built in debug mode.

Missing reference in latest FormsPresenters.WindowsPhone.csproj

The csproj file has the following reference:

....\submodules\MvvmCross\bin\Debug\Mvx\WindowsPhone\Cirrious.MvvmCross.Binding.dll

The submodules directory was there in previous versions but you are now using NuGet to manage most references and so the submodules directory has gone. Presumably this is not a serious error e.g. nothing actually references Cirrious.MvvmCross.Binding.dll?

Testing FormsPresenters NuSpec via NuGet Package Manager Bugs

The NuGet Package Manager fails to install packages into Android and iOS projects.

IDE

Visual Studio 2015

NuGet Version

NuGet Package Manager for Visual Studio ##Version 2015 3.0.60410.213## latest.

Steps to Reproduce

  1. Create Xamarin Solution from VS Template with standard targets.
  2. Update Xamarin.Forms Package to latest.
  3. Clean compile and test all three targets.
  4. Activate NuGet Package Manager Console to manually install Cheesebaron.MvxPlugins.FormsPresenters each project must have packages installed separately as there is no solution level install
  5. Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest -ProjectName SampleApp (installs into the PCL OK)
  6. Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest -ProjectName SampleApp.WinPhone (installs into the Windows Phone project OK)
  7. Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest -ProjectName SampleApp.Droid (fails)
  8. Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest -ProjectName SampleApp.iOS (fails)
  9. Checked references and packages.config of the two projects that were OK.

Failure Logs

Attempting to gather dependencies information for package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2' with respect to project targeting 'MonoAndroid, Version=v5.0'
Attempting to resolve dependencies for package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2'
Resolved actions to install package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2'
Install failed. Rolling back...
Package 'MvvmCross.PortableSupport 3.5.1' does not exist in project 'SampleApp.Droid'
Install-Package : Could not install package 'MvvmCross.PortableSupport 3.5.1'. You are trying to install this package into a project that targets 'MonoAndroid, Version=v5.0', but the package does not 
contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Attempting to gather dependencies information for package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2' with respect to project targeting 'Xamarin.iOS, Version=v1.0'
Attempting to resolve dependencies for package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2'
Resolved actions to install package 'Cheesebaron.MvxPlugins.FormsPresenters.0.0.2'
Install failed. Rolling back...
Package 'MvvmCross.PortableSupport 3.5.1' does not exist in project 'SampleApp.iOS'
Install-Package : Could not install package 'MvvmCross.PortableSupport 3.5.1'. You are trying to install this package into a project that targets 'Xamarin.iOS, Version=v1.0', but the package does not 
contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Cheesebaron.MvxPlugins.FormsPresenters -DependencyVersion Lowest ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Analysis

Could not install package 'MvvmCross.PortableSupport 3.5.1'. You are trying to install this package into a project that targets 'MonoAndroid, Version=v5.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Could not install package 'MvvmCross.PortableSupport 3.5.1'. You are trying to install this package into a project that targets 'Xamarin.iOS, Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

This seems like a similar issue reported against MvvM Cross Could not install package 'MvvmCross.PortableSupport 3.5.0' and closed by Stuart Lodge.

MonoTouch10 is pre-Unified.
3.2 was our last non-Unified release
See release notes on http://slodge.blogspot.com

However the Droid project is showing a similar error that I do not understand. It appears to be that when installing FormsPresenters it knows that it needs 'MvvmCross.PortableSupport 3.5.1' but that package is not compatible with the Consumer, i.e. FormsPresenters.

Fix Connection Change events not firing on Android API24+

Related to #72

When running the Connectivity plugin on Android API24 and up, it fails to trigger Connection Change events.

This is due to the broadcast receiver not triggering on newer API levels unless you attach it directly to a valid Context (thanks, Android...).

James Montemagno's plugin does this by just attaching to Application Context.

Getting this!!!

MvvmCross.Platform.Exceptions.MvxIoCResolveException: Failed to resolve type MvvmCross.Platform.iOS.Views.IMvxIosModalHost

ISettings Int64 problem (iOS)

When I try to read a Int64, I get an error that a Double cannot be converted to a Int64. I changed the iOS code to convert Int64 to string and back, then it works fine. This should not interfere with Android code.

Thanks for your effort to share this code.

Settings plugin does not work with MvvmCross 3.2

I get the following from Nuget after I update my project's core PCL to the new profile as required by the latest mvvmcross:

Could not install package 'Cheesebaron.MvxPlugins.Settings 1.0.2'. You are trying to install this package into a project that targets 'portable-net45+win+wpa81+MonoAndroid10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Connectivity IsConnected on Android only correct set when you change the state

Hi
first of all, thanks for the plugins! :)

I had some issues with the version 2.1 of the connectivity plugin on Android. I noticed that all the properties are false when you start the app even though I have an internet connection via cellular. When I
disable and enable my mobile connection it turns correctly to true, but is false after the next restart.
Also, when I'm in the app and start wlan it turns to true correctly as well.

I've found the same issue on 2.0.1 version of the plugin.

I have an HTC 10 with Android 6.0.1

Change licenses?

Right now we are using Apache 2.0 license for everything. This forces the developer to appropriately attribute this project in their app. Although it seems like no one is aware of this and maybe we should just use a less strict license, such as MIT?

Forms Presenters TODO

  • Fix Android Project to use new Application class from Xamarin.Forms
  • Revisit the NavigationHost etc. on Android. Is it necessary?
  • Expand the Sample to do a bit more than it does now
  • Deploy Movies sample on iOS to see if everything works fine (it should, code is updated)

Stuck at splash screen with Cheesebaron.MvxPlugins.Settings 5.0.0

Hello,
I have correctly working project with Cheesebaron.MvxPlugins.Settings 4.1.2. If I change the Nuget package to 5.0.0, the project compile, but the resulting app stuck at splash screen (tested on Android).
From debugging, I can tell that

public MainApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
public SplashScreen() : base(Resource.Layout.splash_screen)

are called (both have empty bodies) and that is all. No Initalize or another code is called after that and when I stop the project I get "No compatible code running".
Any idea, what might be wrong?

Thanks,
Petr

Failed to resolve parameter for parameter wifi of type IWifi

Problem: Failed to resolve parameter for parameter wifi of type IWifi

Reference: Cheesebaron.MvxPlugins.Connectivity
Version: 3.0.2
Framework: uap10 (w/ netstandard 1.4)

Here's my bootstrap implementation:

public class DeviceInfoBootstrap : MvxPluginBootstrapAction<PluginLoader> { }

System.IO.FileNotFoundException while bootstrapping Cheesebaron.MvxPlugins.DeviceInfo

Problem: I get System.IO.FileNotFoundException while bootstrapping Cheesebaron.MvxPlugins.DeviceInfo in my Universal Windows project.

Reference: Cheesebaron.MvxPlugins.DeviceInfo
Version: 2.2.2
Framework: uap10 (w/ netstandard 1.4)

Here's my bootstrap implementation:

public class DeviceInfoBootstrap : MvxPluginBootstrapAction<PluginLoader> { }

Following few exception details:
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
Additional information: Could not load file or assembly 'Cheesebaron.MvxPlugins.DeviceInfo.WindowsUWP, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

could not load plugin assembly for type Cheesebaron.MvxPlugins.Settings.PluginLoader

Please I am having the following problem Running my MVVMCross Application on a Windows Phone 8 Device

My Package Config is:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Bulboss.MvvmCross.Plugins.UserInteraction" version="1.3.1" targetFramework="wp8" />
  <package id="Cheesebaron.MvxPlugins.Settings" version="2.1.0" targetFramework="wp8" />
  <package id="Microsoft.Bcl" version="1.1.9" targetFramework="wp8" />
  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="wp8" />
  <package id="Microsoft.Net.Http" version="2.2.22" targetFramework="wp8" />
  <package id="MvvmCross" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Binding" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Core" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Platform" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.File" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.Json" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.Location" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.Messenger" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.Network" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.Plugin.Visibility" version="4.3.0" targetFramework="wp8" />
  <package id="MvvmCross.StarterPack" version="4.3.0" targetFramework="wp8" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="wp8" />
  <package id="WPtoolkit" version="4.2013.08.16" targetFramework="wp8" />
</packages>

I have the plugin bootstrapped as follows

 public class SettingsPluginBootstrap : MvxPluginBootstrapAction<Cheesebaron.MvxPlugins.Settings.PluginLoader>
    {

    }

And I use the Settings Plugin like so

public class SettingsService
    {

        private ISettings _settings;

        public SettingsService(ISettings settingsService)
        {
            _settings = settingsService;
        }
}

My windows Phone Application Constructor Is Setup as follows

 public App()
        {
            var setup = new Setup(RootFrame);
            setup.Initialize();
        }

But whenever setup.Initialize() is called. I get the followin exception

Additional information: could not load plugin assembly for type Cheesebaron.MvxPlugins.Settings.PluginLoader
   at MvvmCross.Platform.Plugins.MvxFilePluginManager.LoadAssembly(Type toLoad)
   at MvvmCross.Platform.Plugins.MvxFilePluginManager.FindPlugin(Type toLoad)
   at MvvmCross.Platform.Plugins.MvxPluginManager.ExceptionWrappedLoadPlugin(Type toLoad)
   at MvvmCross.Platform.Plugins.MvxPluginManager.EnsurePlatformAdaptionLoaded[T]()
   at Cheesebaron.MvxPlugins.Settings.PluginLoader.EnsureLoaded()
   at MvvmCross.Platform.Plugins.MvxPluginManager.EnsurePluginLoaded(IMvxPluginLoader pluginLoader)
   at MvvmCross.Platform.Plugins.MvxPluginManager.EnsurePluginLoaded(Type type)
   at MvvmCross.Platform.Plugins.MvxPluginManager.EnsurePluginLoaded[TType]()
   at MvvmCross.Platform.Plugins.MvxPluginBootstrapAction`1.Load(IMvxPluginManager manager)
   at MvvmCross.Platform.Plugins.MvxPluginBootstrapAction`1.RunAction()
   at System.Action.Invoke()
   at MvvmCross.Platform.IoC.MvxSimpleIoCContainer.InternalSetResolver(Type tInterface, IResolver resolver)
   at MvvmCross.Platform.IoC.MvxSimpleIoCContainer.RegisterSingleton[TInterface](TInterface theObject)
   at MvvmCross.Platform.Mvx.RegisterSingleton[TInterface](TInterface service)
   at MvvmCross.Core.Platform.MvxSetup.InitializePluginFramework()
   at MvvmCross.Core.Platform.MvxSetup.InitializeSecondary()
   at MvvmCross.Core.Platform.MvxSetup.Initialize()
   at IGovern.WinPhone.App..ctor()

Please What Am I Doing Wrong???

'jobject' must not be IntPtr.Zero when ISettings.GetValueOrDefault<string> is invoked

Hi,
when I try to invoke ISettings.GetValueOrDefault I receive the following Exception:

An exception occurred at AddFavoriteService: 'jobject' must not be IntPtr.Zero.
Parameter name: jobject - StackTrace: at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in :0
at Android.Content.ISharedPreferencesInvoker.GetString (System.String key, System.String defValue) [0x00000] in :0
at Refractored.MvxPlugins.Settings.Droid.MvxAndroidSettings.GetValueOrDefault[String](System.String key, System.String defaultValue) [0x00000] in :0
at Myproject.Core.PCL\Data\UserPreferences.AddFavoriteService (System.String cityId, System.String serviceId) [0x00014] in c:\Myproject.Core.PCL\Data\UserPreferences.cs:45
at Android.Content.ISharedPreferencesInvoker.GetString (System.String key, System.String defValue) [0x00000] in :0
at Refractored.MvxPlugins.Settings.Droid.MvxAndroidSettings.GetValueOrDefault[String](System.String key, System.String defaultValue) [0x00000] in :0
at Myproject.Core.PCL\Data\UserPreferences.AddFavoriteService (System.String cityId, System.String serviceId) [0x00014] in c:\Myproject.Core.PCL\Data\UserPreferences.cs:45

Here the code of UserPreferences.cs

public class UserPreferences
{
#region Const & Field
private readonly ISettings _settingsProvider;
#endregion

    public UserPreferences(ISettings settings)
    {
        _settingsProvider = settings;
    }

    public bool AddFavoriteService(string cityId, string serviceId)
    {
        try
        {
            var cf = _settingsProvider.GetValueOrDefault<string>(cityId, string.Empty);

            var cfList = JsonConvert.DeserializeObject<List<string>>(cf);

            if (cfList == null)
                cfList = new List<string>();

            var ele = cfList.Find(x => string.Compare(x, serviceId, StringComparison.CurrentCultureIgnoreCase) == 0);

            if (ele == null)
            {
                cfList.Add(serviceId);
                var newCfList = JsonConvert.SerializeObject(cfList);
                _settingsProvider.AddOrUpdateValue(cityId, newCfList);
                _settingsProvider.Save();
            }
            return true;
        }
        catch(Exception e)
        {
            Debug.WriteLine("An exception occurred at AddFavoriteService: {0} - StackTrace: {1}", e.Message,
                e.StackTrace);
            return false;
        }
    }

}

Settings nuget package for Touch

So here's what i've experienced: I install the Settings nuget package in my core, droid and touch project. It works on Android. But for my touch project, i cannot instantiate my viewmodel, as it uses the ISettings service. Likewise, Mvx.CanResolve() returns false.

If i pull the code here from github, and add it as regular projects which i reference, everything works fine.

It seems to me there might be a problem with the nuget package?

Missing reference in latest FormsPresenters.WindowsPhone.csproj

The csproj file has the following reference:

....\submodules\MvvmCross\bin\Debug\Mvx\WindowsPhone\Cirrious.MvvmCross.Binding.dll

The submodules directory was there in previous versions but you are now using NuGet to manage most references and so the submodules directory has gone. Presumably this is not a serious error e.g. nothing actually references Cirrious.MvvmCross.Binding.dll?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.