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

  • SEARCH
  • Home
  • 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 7916087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:40:46+00:00 2026-06-03T14:40:46+00:00

I am using MonoTouch.Dialog to create a settings-like page. The linq below creates a

  • 0

I am using MonoTouch.Dialog to create a settings-like page. The linq below creates a set of RootElements, each with one section that has a set of RadioEventElements (a subclass of RadioElement that I created in order to add an OnSelected event).

        // initialize other phone settings by creating a radio element list for each phone setting
        var elements = (from ps in PhoneSettings.Settings.Keys select (Element) new RootElement(ps, new RadioGroup(null, 0))).ToList();

        // loop through the root elements we just created and create their substructure
        foreach (RootElement rootElement in elements)
        {
            rootElement.Add(new Section()
            {
                (from val in PhoneSettings.Settings[rootElement.Caption].Values select (Element) new RadioEventElement(val.Name)).ToList()
            });
            // ...
        }       

One of the settings I implement is a “Theme” – which currently is simply a background color for the various screens in the app. I can style every one of the pages correctly by setting the TableView.BackgroundColor property to the desired color… Except for new DialogViewControllers that are automatically created and pushed by the parent DialogViewController when it navigates into a radio group.

Is there any way to style (or at least set the background color) of this child DialogViewController?

  • 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-03T14:40:47+00:00Added an answer on June 3, 2026 at 2:40 pm

    I need to use the assembly browser more before asking easy questions 🙂

    Fortunately the RootElement has a virtual method called PrepareDialogViewController for what appears to be exactly this purpose. All I had to do is create a simple subclass of RootElement and override this method to get my desired behavior.

    public class ThemedRootElement : RootElement 
    {    
        public ThemedRootElement(string caption) : base (caption)
        {
        }
    
        public ThemedRootElement(string caption, Func<RootElement, UIViewController> createOnSelected) : base (caption, createOnSelected)
        {
        }
    
        public ThemedRootElement(string caption, int section, int element) : base (caption, section, element)
        {
        }
    
        public ThemedRootElement(string caption, Group group) : base (caption, group)
        {
        }
    
        protected override void PrepareDialogViewController(UIViewController dvc)
        {
            dvc.View.BackgroundColor = UIColorHelper.FromString(App.ViewModel.Theme.PageBackground);
            base.PrepareDialogViewController(dvc);
        }
    }
    

    Hopefully this helps save someone out there a litte time…

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

Sidebar

Related Questions

It's easy to create a multi-level menu structure using nested RootElements in MonoTouch.Dialog but
using MonoTouch.Dialog I create a simple ViewController: In the LoadView I set the background
I am trying to implement a Settings dialog for iOS using MonoTouch and the
I am trying to build an app using MonoTouch and MonoTouch.Dialog. I really like
Is this possible at all? When I create a form using MonoTouch.Dialog, it comes
I'm using the MonoTouch.Dialog reflection API to create a new DialogViewController: var dashBoard =
Using MonoTouch.Dialog is it possible to freeze the first/top row (like a table header)?
I am building a phonegap like solution using MonoTouch & UIWebView . I would
I would like to use MonoTouch.Dialog framewrok to display some readonly info. I think
When i first started using monotouch i found a page with some code samples

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.