Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:34:13+00:00 2026-06-10T11:34:13+00:00

I am refactoring an app using MvvmCross and I am in the midst of

  • 0

I am refactoring an app using MvvmCross and I am in the midst of getting a Settings View to show on the three platforms: WP7, Android and iPhone. I have created a SettingsViewModel which holds two lists. One with Update Frequencies to poll a server and another one with information for which server to poll. These are called UpdateFrequencies and PublicSites. The two lists each have a property in the SettingsViewModel to determine which UpdateFrequency and which Site has been selected, UpdateFrequency and SelectedSite.

On WP7 this data is bound to a ListPicker like this:

<toolkit:ListPicker 
    Name="UpdateFrequencies"
    ItemsSource="{Binding UpdateFrequencies}"
    SelectedItem="{Binding UpdateFrequency, Mode=TwoWay}"
    Header="Real-time data update frequency"
    />

SettingsView WP7

Similarly on Android it is bound to a Spinner like this:

<cirrious.mvvmcross.binding.android.views.MvxBindableSpinner
    android:id="@+id/SpinnerUpdateFrequencies"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    local:MvxDropDownItemTemplate="@layout/spinneritem_updatefrequencydropdown"
    local:MvxItemTemplate="@layout/spinneritem_updatefrequency"
    local:MvxBind="{'ItemsSource':{'Path':'UpdateFrequencies'},'SelectedItem':{'Path':'UpdateFrequency','Mode':'TwoWay'}}"
    />

SettingsView Android

Now I am trying to do the same on iPhone and I just can’t seem to wrap my head around how to bind it in a similar fashion. I have been looking through all the samples I could find and cannot seem to find something similar. Can someone maybe point me in the correct direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:34:15+00:00Added an answer on June 10, 2026 at 11:34 am

    The mvvmcross ios source doesn’t currently include this – so you’ll need to write your own.

    If you’re working with monotouch dialog, then this means you’ll need to create a new element type and use this to display both a static text field (the current value) and a picker view (the list of choices).

    The good news is that this is quite similar to what the current TimeElement and DateElement do – so you can use one of those as a starting template. To adapt this template, you’ll need to:

    • change it so that the Value is based on a String rather than a DateTime
    • add a List public property – which will be the list of Choices. As this is public and a property, it can be automatically used for data binding.
    • adapt the Selected handler so that the Element displays a simple text based picker view rather than a date or time picker view when tapped – head over to wally’s blog for info on using a pickerview (http://weblogs.asp.net/wallym/archive/2010/01/07/uipicker-in-the-iphone-with-monotouch.aspx) – or follow the advice from @r4j above
    • add a picker view model that shows the correct values (from Choices), that defaults to the current Value, and that sets the Value when the picker is done (setting the Value will cause the bound ViewModel property to also be updated).

    This approach does assume that the Value and the Choices list won’t change while the Picker is displayed – but that’s a very safe assumption for most uses.

    Sorry, I can’t provide sample code (or an addition to the library) right now. If someone else doesn’t beat me to it, then I’ll try to add one when I’m back on a dev box in a couple of days from now.


    As an extra idea, one alternative approach to providing a ui for these settings is to try to use the radio/radio group approach within monotouch.dialog. However, I’m afraid this would also require a little new Element work – as the current radio implementation isn’t set up to work with (bind to) a list of choices dynamically. When I get time, I’ll look at adding this too – as I think it would be a very useful addition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am refactoring some legacy code. The app was not using querystrings. The previous
I have been happily refactoring code from different versions of the same app (paid/free)
I have an Iphone app that used the excellent ABContactHelper library origionally written for
I have an Android app in the Market and I want to push an
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
We have a web app that is using MVC Preview 3. I'm new to
can anyone help me with bit of refactoring advice. I have my App which
I have an existing large app using plists to store its data. I store
I am refactoring a part of our legacy app which handles exporting and importing
I'm currently refactoring some Javascript code we have and amongst other things I've changed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.