iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Latest Development Blogs
ForumPostTopic
Browse By Tag
Is there anyway to add icons to the navigation menu?
1. Add your icon in ‘Resources - > drawable’ folder, under Android project.
2. Under Android project, there is ‘NavigationViewModel.cs’ file, in ViewModel folder. In that file, I modify a line of code
From: items.Add(new NavigationItem("About This App", "About", typeof(AboutNavigationViewModel))); To: items.Add(new NavigationItem("About This App", "About", typeof(AboutNavigationViewModel)) { Image = "icon.png" });
3. Under Android project, there is ‘navigation_item_layout.axml’ file, in Resources -> layout folder. In that file, I add a line of code:
<ImageView android:id="@+id/ImageView" android:layout_width="20dp" android:layout_height="20dp" android:layout_gravity="center" android:layout_marginLeft="20dp" android:layout_marginTop="2dp" />
You should use “@+id/ImageView” for “android:id”.
protected override int ListItemLayoutId { get { return Resource.Layout.navigation_item_layout; } }
5. Under Core project, ‘NavigationBindingProvider.cs’ file, in BindingProviders folder. In that file, I add a line of code in ‘NavigationBindingProvider()’ function:
ItemBindingDescription itemBinding = new ItemBindingDescription { DisplayMemberPath = "Title", NavigateMemberPath = "Target", ImageMemberPath = "Image" };
You could do the same thing for iOS & WinPhone project.
You could get the project from this link: http://1drv.ms/1ryoC2T. Please kindly have review on the project and let me know your response.
For further information regarding Navigation Item, please kindly follow this link:
http://developer.intersoftpt.com/display/crosslight/Using+List+as+Navigation+Interface
Thank you.
Regards,
Hans K.
using Intersoft.Crosslight; namespace IncroudRadio.BindingProviders { public class NavigationBindingProvider : BindingProvider { #region Constructors public NavigationBindingProvider() { var itemBinding = new ItemBindingDescription { // DisplayMemberPath = "Title", NavigateMemberPath = "Target", //ImageMemberPath = "Image", }; AddBinding("TableView", BindableProperties.ItemsSourceProperty, "Items"); AddBinding("TableView", BindableProperties.ItemTemplateBindingProperty, itemBinding, true); AddBinding("TableView", BindableProperties.SelectedItemProperty, "SelectedItem", BindingMode.TwoWay); itemBinding.AddBinding("Title", BindableProperties.TextProperty, "Title"); itemBinding.AddBinding("Image", BindableProperties.ImageSourceProperty, "Image"); } #endregion } }
I got it all working on iOS on another view but I noticed another problem. I'm loading the images via async await via the loadservice.LoadImageAsync. The Table populates but it doesn't scroll I think because it doesn't get the count correctly because of the await? I only speculate this because I see the foot load while the images are downloading...
FIXED - I added another Item to the list and now it scrolls properly! So it had to do with the the cells being very large and the table not realizing it so the footer wasn't showing.
Nevermind, it was a fluke that it started scrolling. It doesn't scroll anymore.
Hello,We glad to hear that you have achieved the scenario that you want.Should you have further question, please do not hesitate to contact us.Regards,Hans K.
Well its still crashing in iOS when I have ImageMemberPath unset... So this needs to be fixed.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname