iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I tried to make a static method to Open the Drawer from another button in another ViewController but am unable to do so.
public static void OpenIt() { Open (DrawerSide.Left); }
but Open is a Non-Static member and hard-coded so I cannot change it. How can I slide open the Drawer from another ViewModel not in the DrawerViewModel?
I created a project using Navigation Drawer template. It has ShowToast() method in SimpleViewModel so that when user press Button1, it will show a ToastPresenter which returns NewText property.
I modified the ShowToast() method to open the drawer by using following snippet code:
private void ShowToast(object parameter) { IDrawerViewModel drawerViewModel = IocContainer.Current.Resolve<IDrawerViewModel>(); if (drawerViewModel != null) drawerViewModel.Open(DrawerSide.Left); }
Please note that I'm using IoCContainer class to get the instance of DrawerViewModel. The registrar is specified in the contructor of DrawerViewModel.
public DrawerViewModel() { this.LeftViewModel = new NavigationViewModel(); this.CenterViewModel = new SimpleViewModel(); //this.Open(DrawerSide.Left); IocContainer.Current.RegisterInstance<IDrawerViewModel>(this); }
After saving the changes, pressing Button1 will open the drawer.
Hope this help.
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