Пример #1
0
        public override void Attach(ViewModelBase viewModel)
        {
            FBViewModel vm = (FBViewModel)viewModel;

            vm.RC_FBTestCMD.Subscribe(_ => {
                FBTestCMD((FBViewModel)viewModel);
            }).AddTo(viewModel.baseAttachDisposables);
        }
Пример #2
0
        public override void CreateViewModel()
        {
            if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson))
            {
                VM = new FBViewModel();
            }
            else
            {
                VM = JsonConvert.DeserializeObject <FBViewModel> (ViewModelInitValueJson);
                ViewModelPropertyRef();
            }

            VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this);
        }
Пример #3
0
        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);
        }
Пример #5
0
 /*  */
 public override void FBTestCMD(FBViewModel viewModel)
 {
     base.FBTestCMD(viewModel);
 }
Пример #6
0
 /*  */
 public virtual void FBTestCMD(FBViewModel viewModel)
 {
 }
Пример #7
0
 public override void SetViewModel(ViewModelBase viewModel)
 {
     VM = (FBViewModel)viewModel;
 }
 public Post(FBViewModel fBViewModel)
 {
     ViewModel          = fBViewModel;
     ReactionText       = "Like";
     MoreIconVisibility = true;
 }