Beispiel #1
0
        public ActionResult PageTitle()
        {
            var pageData  = _scContext.GetCurrentItem <IPageTitle>();
            var viewModel = new PageTitleViewModel
            {
                Title   = _builder.BuildHtmlString(pageData, p => p.Title).ToString(),
                Summary = _builder.BuildHtmlString(pageData, p => p.Summary).ToString()
            };

            return(this.React("PageTitle", viewModel));
        }
        // Le titre passé en Binding

        public CustomContentPage()
        {
            // Pour modifier les données bindées du ControlTemplate
            pageTitleViewModel = new PageTitleViewModel();
            pageTitleViewModel.ParentPage = this;
            BindingContext = pageTitleViewModel;

            InitializeComponent();

            // Création de la listView
            CreateListView();

            // On efface la clé de recherche au premier chargement
            //SearchString = "";

            // Le spinner
            UserDialogs = new UserDialogs();
            UserDialogs.ShowSpinner();


            // pour enlever la barre de navigation par défaut
            NavigationPage.SetHasNavigationBar(this, false);

            // Pour ne pas masquer la barre d'état iOS
            if (Device.RuntimePlatform == Device.iOS)
            {
                Padding = new Thickness(0, 20, 0, 0);
            }

            // Est ce que l'image No Network est visible ?
            var isVisible = Global.GetSettings(TypeSettings.IsHorsConnexion);
            if (isVisible != null)
            {
                pageTitleViewModel.IsHorsConnexionVisible = bool.Parse(isVisible);
            }
            else
            {
                pageTitleViewModel.IsHorsConnexionVisible = false;
            }


  

        }
Beispiel #3
0
        public ActionResult Index()
        {
            string pageTitle = String.Empty;

            if (this.IsDefaultTitle)
            {
                pageTitle = SiteMapBase.GetActualCurrentNode().Title;
            }
            else
            {
                pageTitle = this.CustomPageTitle;
            }

            var viewModel = new PageTitleViewModel()
            {
                PageTitle = pageTitle
            };

            ViewBag.CssClass = CssClass;

            return(View("Simple", viewModel));
        }
Beispiel #4
0
        /// <summary>
        /// Gets the index.
        /// </summary>
        ///
        /// <returns>
        /// An ActionResult.
        /// </returns>
        public ActionResult Index()
        {
            var model = new PageTitleViewModel
            {
                TextTag = TextTag
            };

            //CONSTUCT TITLE
            if (string.IsNullOrEmpty(Text))
            {
                try
                {
                    //USE CURRENT PAGE TO DETERMINE TITLE
                    var currentPage = BabaManagers.Pages.GetCurrentSiteMapNode();
                    if (currentPage != null)
                    {
                        //DETERMINE TEXT TO DISPLAY FROM CURRENT NODE
                        model.Title = ShowParentTitle && currentPage.ParentNode != null
                            ? currentPage.ParentNode.Title
                            : currentPage.Title;
                    }
                }
                catch (Exception ex)
                {
                    //TODO: SAFELY GET RID OF TRY/CATCH FOR PERFORMANCE
                    LogHelper.LogException(ex);
                }
            }
            else
            {
                //RENDER DEFAULT TEXT TO PAGE
                model.Title = Text;
            }

            return(EmbeddedView(model));
        }