c# - FlyoutNavigation Controller -


using monodevelop, have been looking @ ios implementation of side slide out menu using flyoutnavigationcontroller, have hit couple of stumbling blocks.

firstly, how can access font elements of generated list?
can modify row heights etc, unsure of how proceed modifying list items, can down tablesource , item styling?

secondly, how open view list? empty view used default new views opened side menu list, have tried using push navigation controller fails open.

any ideas more welcome.

navigation = new flyoutnavigationcontroller(); navigation.view.frame = uiscreen.mainscreen.bounds; view.addsubview(navigation.view);  navigation.navigationroot = new rootelement ("menu list")  {     new section ("menu list")      {         page in slidelist         select new stringelement (page.title) element     } };  navigation.navigationtableview.backgroundcolor = uicolor.darkgray; navigation.navigationtableview.rowheight = 30; navigation.navigationtableview.separatorstyle = uitableviewcellseparatorstyle.singleline; navigation.navigationtableview.separatorcolor = uicolor.lightgray; navigation.navigationtableview.sectionheaderheight = 60; //navigation.navigationtableview.datasource = slidelist;   //navigation.viewcontrollers = array.convertall (menuitems, title => new uinavigationcontroller (new taskpagecontroller (navigation, title)));  navigation.viewcontrollers = array.convertall (menuitems, title => new taskpagecontroller (navigation, title));  this.navigationitem.leftbarbuttonitem = new uibarbuttonitem (uibarbuttonsystemitem.action, delegate {                 navigation.togglemenu(); }); 

i haven't used flyoutnavigationcontroller before, took @ example: https://github.com/xamarin/flyoutnavigation

it looks you're supposed have same number of stringelements controllers. viewcontrollers array, looks can supply own custom controllers instead of plain viewcontrollers. after that, clicking list item should automatically navigate appropriate controller.

in regards styling, looking @ source navigationcontroller, don't see in terms of being able stylize cells. did quick search how go styling monotouch dialog lists , looks there isn't easy way without subclassing elements:

monotouch dialog: styling elements

however, can share how i've accomplished 2 questions asked without dialog framework.

you can create custom class extends uitableviewsource: http://docs.xamarin.com/guides/ios/user_interface/tables/part_2_-_populating_a_table_with_data

in getcell method override, can grab instance of cell's label , set font so:

cell.textlabel.font = uifont.fromname("titlinggothicfb cond", 20); 

another thing can custom uitableviewsource class create custom event:

public event eventhandler listitemselected; 

inside rowselected method can dispatch event:

public override void rowselected (uitableview tableview, monotouch.foundation.nsindexpath indexpath) {      listitemselected(this, new mycustomeventargs(indexpath.row)); } 

in controller class responsible instantiating tablesource, can listen , handle event so:

var customtablesource = new customtablesource(mylist); mytable.source = customtablesource; customtablesource.listitemselected += (object sender, eventargs e) => {      if((e mycustomeventargs).rowselected == 1){           this.navigationcontroller.pushviewcontroller(new mynextviewcontroller(), true));      } } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -