public override void Attach(ViewModelBase viewModel) { FBViewModel vm = (FBViewModel)viewModel; vm.RC_FBTestCMD.Subscribe(_ => { FBTestCMD((FBViewModel)viewModel); }).AddTo(viewModel.baseAttachDisposables); }
public override void CreateViewModel() { if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson)) { VM = new FBViewModel(); } else { VM = JsonConvert.DeserializeObject <FBViewModel> (ViewModelInitValueJson); ViewModelPropertyRef(); } VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this); }
public override void Initialize(ViewModelBase viewModel) { if (viewModel != null) { VM = (FBViewModel)viewModel; VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this); } else { if (AutoCreateViewModel && VM == null) { CreateViewModel(); } } base.Initialize(VM); }
public MainPage(FBViewModel viewModel) { InitializeComponent(); fBViewModel = viewModel; BindingContext = fBViewModel.LoggedInUser; menuItems = new List <HomeMenuItem> { new HomeMenuItem { Id = MenuItemType.Home, Title = "Home" }, new HomeMenuItem { Id = MenuItemType.Profile, Title = "Profile" }, new HomeMenuItem { Id = MenuItemType.About, Title = "About" }, }; ListViewMenu.ItemsSource = menuItems; ListViewMenu.SelectedItem = menuItems[0]; ListViewMenu.ItemTapped += async(sender, e) => { if (e.ItemData == null) { return; } var id = (int)((HomeMenuItem)e.ItemData).Id; await NavigateFromMenu(id); }; MasterBehavior = MasterBehavior.Popover; Detail = new NavigationPage(new FB_PostHomePage(fBViewModel)); MenuPages.Add((int)MenuItemType.Home, (NavigationPage)Detail); }
/* */ public override void FBTestCMD(FBViewModel viewModel) { base.FBTestCMD(viewModel); }
/* */ public virtual void FBTestCMD(FBViewModel viewModel) { }
public override void SetViewModel(ViewModelBase viewModel) { VM = (FBViewModel)viewModel; }
public Post(FBViewModel fBViewModel) { ViewModel = fBViewModel; ReactionText = "Like"; MoreIconVisibility = true; }