private void SearchText_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Down && VideosView.SelectedIndex < VideosView.Items.Count) { VideosView.SelectedIndex += 1; } if (e.Key == Key.Up && VideosView.SelectedIndex > 0) { VideosView.SelectedIndex -= 1; } VideosView.ScrollIntoView(VideosView.SelectedItem); }
/// <summary> /// Shows the details view. /// </summary> public async Task ShowDetailsAsync() { if (CategoriesList.SelectedIndex < 0) { return; } SearchCategoryItem Item = CategoriesList.SelectedItem as SearchCategoryItem; if (Item.FilterType == SearchFilterEnum.None) { return; } if (Item.FilterValue == null && (Item.FilterType == SearchFilterEnum.Artist || Item.FilterType == SearchFilterEnum.Category || Item.FilterType == SearchFilterEnum.Element)) { // Change category group type. SearchGroupType = Item.FilterType; await LoadCategoriesAsync(); } else { // Open details view. IsDetailView = true; Settings.IsInDatabase = (Item.FilterType != SearchFilterEnum.Files); bool HasArtistColumn = (Item.FilterType != SearchFilterEnum.Artist || Item.FilterValue != "") && Item.FilterType != SearchFilterEnum.Files; ArtistColumn.Width = HasArtistColumn ? 80 : 0; Settings.FilterType = Item.FilterType; Settings.FilterValue = Item.FilterValue; Settings.DisplayCustomRating = (Item.FilterType == SearchFilterEnum.Element) ? Item.FilterValue : null; if (VideosView.HasItems) { VideosView.SelectedIndex = 0; VideosView.ScrollIntoView(VideosView.Items[0]); } await LoadDataAsync(); StoryboardOpenDetail.Seek(this, TimeSpan.Zero, TimeSeekOrigin.BeginTime); StoryboardOpenDetail.Begin(); ShowCategoryLabel(); } }
public ViewResult Videos() { List <string> youtubeVideoIds = new List <string>() { "5qap5aO4i9A", "EHtsQ9thkIY", "0rBG9BAiiC4", "cCwiZdFz63w", "fb9-OzVuV6g", "-y8aKyi6-OQ", "kVaiWk7H7n0", "UDA6Kd6uYqs", "eg9_ymCEAF8", "Q8vnqwtOf8E" }; // This data has been moved into a ViewModel // ViewBag.YoutubeVideoIds = youtubeVideoIds; // ViewBag.RandomNumber = new System.Random().Next(); VideosView videosViewModel = new VideosView() { YoutubeVideoIds = youtubeVideoIds, RandomNumber = new Random().Next() }; return(View("Videos", videosViewModel)); }
public override void DataBind() { if (_bound) { return; } _bound = true; MediaGalleryManager mgMgr = new MediaGalleryManager(); string title = ""; if (VideoId != null) { Video v = mgMgr.GetVideo(VideoId.Value); this.DataItem = v; title = v.Title; } else if (VideoName != "") { VideosView v = mgMgr.GetVideoDetails(VideoName); this.DataItem = v; title = v.Title; } base.DataBind(); if (!String.IsNullOrWhiteSpace(title)) { if (MyPage != null) { Config cfg = new Config(); MyPage.CustomTitle = string.Format("{0} Video - {1}", StringUtils.StripOutHtmlTags(title), cfg.GetKey("SiteName")); } } }
public override void DataBind() { if (this._bound) { return; } _bound = true; int _videoId = -1; object obj = DataBinder.Eval(this.NamingContainer, "DataItem.VideoId"); if (!String.IsNullOrEmpty(obj.ToString())) { _videoId = (int)obj; } else { return; } MediaGalleryManager mMgr = new MediaGalleryManager(); VideosView _videoView = mMgr.GetVideoView(_videoId); string text = _videoView.Title; switch (Type) { case VideoLinkType.ArchiveByType: text = _videoView.VideoCategoryTitle; this.HRef = string.Format("{2}/{0}/{1}.aspx", Path == "" ? "video-categories" : Path, _videoView.VideoCategoryUniqueName, WebContext.Root); break; case VideoLinkType.VideoID: if (IncludeVideoCategoryPath) { this.HRef = string.Format("{3}/{0}{1}/{2}{4}", Path == "" ? "" : Path + "/", _videoView.VideoCategoryUniqueName, _videoView.VideoId, WebContext.Root, Extension ); } else { this.HRef = string.Format("{2}/{0}{1}{3}", Path == "" ? "" : Path + "/", _videoView.VideoId, WebContext.Root, Extension ); } break; case VideoLinkType.Video: default: this.HRef = string.Format("{2}/{0}/{1}{3}", Path == "" ? "videos" : Path, _videoView.UniqueName, WebContext.Root, Extension ); if (IncludeVideoCategoryPath) { this.HRef = string.Format("{3}/{0}/{1}/{2}{4}", Path == "" ? "videos" : Path, _videoView.VideoCategoryUniqueName, _videoView.UniqueName, WebContext.Root, Extension ); } else { this.HRef = string.Format("{2}/{0}/{1}{3}", Path == "" ? "videos" : Path, _videoView.UniqueName, WebContext.Root, Extension ); } break; } if (this.Controls.Count == 0) { this.InnerHtml = string.Format(Format, text); } base.DataBind(); if (MyPage.Editable && ImEditable) { this.Attributes.Add("data-editable", "true"); this.Attributes.Add("data-id", _videoId.ToString()); this.Attributes.Add("data-type", "videos"); } }
// PAGES: private void CreateHomePage() { var result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.HomePageId), "Home", true, false, "en"); if (result) { SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.HomePageId), new Guid(SampleConstants.EducationTemplateId), "en"); var mainLayoutControl = new LayoutControl(); var mainLayoutColumns = new List<ColumnDetails>(); var mainLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 15, 0, 0), PlaceholderId = "Left" }; mainLayoutColumns.Add(mainLayoutColumn1); var mainLayoutColumn2 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 15), PlaceholderId = "Right" }; mainLayoutColumns.Add(mainLayoutColumn2); mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty); mainLayoutControl.ID = "Main"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), mainLayoutControl, "content", "50% + 50% (custom)", "en"); //Left content #region Latest News Content Block var latestNewsBlockLayout = new LayoutControl(); var latestNewsBlockLayoutColumns = new List<ColumnDetails>(); var latestNewsBlockLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; latestNewsBlockLayoutColumns.Add(latestNewsBlockLayoutColumn1); latestNewsBlockLayout.Layout = SampleUtilities.GenerateLayoutTemplate(latestNewsBlockLayoutColumns, string.Empty); latestNewsBlockLayout.ID = "LatestNewsBlockLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNewsBlockLayout, "Main_Left", "100%", "en"); ContentBlockBase latestNewsBlock = new ContentBlockBase(); latestNewsBlock.Html = @"<h1>Latest university news</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNewsBlock, "LatestNewsBlockLayout_Content", "Content block", "en"); #endregion #region Latest News View var latestNewsViewLayout = new LayoutControl(); var latestNewsViewLayoutColumns = new List<ColumnDetails>(); var latestNewsViewLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; latestNewsViewLayoutColumns.Add(latestNewsViewLayoutColumn1); latestNewsViewLayout.Layout = SampleUtilities.GenerateLayoutTemplate(latestNewsViewLayoutColumns, string.Empty); latestNewsViewLayout.ID = "LatestNewsViewLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNewsViewLayout, "Main_Left", "100%", "en"); NewsView latestNews = new NewsView(); latestNews.MasterViewName = SampleConstants.EducationNewsSummaryContentViewName; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNews, "LatestNewsViewLayout_Content", "News", "en"); #endregion #region Videos Content Block var videosBlockLayout = new LayoutControl(); var videosBlockLayoutColumns = new List<ColumnDetails>(); var videosBlockLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; videosBlockLayoutColumns.Add(videosBlockLayoutColumn1); videosBlockLayout.Layout = SampleUtilities.GenerateLayoutTemplate(videosBlockLayoutColumns, string.Empty); videosBlockLayout.ID = "VideosBlockLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), videosBlockLayout, "Main_Left", "100%", "en"); ContentBlockBase videosBlock = new ContentBlockBase(); videosBlock.Html = @"<h1>Videos</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), videosBlock, "VideosBlockLayout_Content", "Content block", "en"); #endregion #region Videos view var videosViewLayout = new LayoutControl(); var videosViewLayoutColumns = new List<ColumnDetails>(); var videosViewLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; videosViewLayoutColumns.Add(videosViewLayoutColumn1); videosViewLayout.Layout = SampleUtilities.GenerateLayoutTemplate(videosViewLayoutColumns, string.Empty); videosViewLayout.ID = "VideosViewLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), videosViewLayout, "Main_Left", "100%", "en"); VideosView videoGallery = new VideosView(); videoGallery.MasterViewName = SampleConstants.VideosEducationFrontendLightBoxViewName; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), videoGallery, "VideosViewLayout_Content", "Video gallery", "en"); #endregion #region Meet us Image var meetUsImageLayout = new LayoutControl(); var meetUsImageLayoutColumns = new List<ColumnDetails>(); var meetUsImageLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; meetUsImageLayoutColumns.Add(meetUsImageLayoutColumn1); meetUsImageLayout.Layout = SampleUtilities.GenerateLayoutTemplate(meetUsImageLayoutColumns, string.Empty); meetUsImageLayout.ID = "MeetUsImageLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), meetUsImageLayout, "Main_Left", "100%", "en"); ImageControl meetUsImage = new ImageControl(); meetUsImage.CssClass = "sfimageWrp bottomImage"; meetUsImage.ImageId = SampleUtilities.GetLocalizedImageId("1meet_us", "en"); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), meetUsImage, "MeetUsImageLayout_Content", "Image", "en"); #endregion //Right content #region Upcoming events block var upcomingEventsBlockLayout = new LayoutControl(); var upcomingEventsBlockLayoutColumns = new List<ColumnDetails>(); var upcomingEventsBlockLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; upcomingEventsBlockLayoutColumns.Add(upcomingEventsBlockLayoutColumn1); upcomingEventsBlockLayout.Layout = SampleUtilities.GenerateLayoutTemplate(upcomingEventsBlockLayoutColumns, string.Empty); upcomingEventsBlockLayout.ID = "UpcomingEventsBlockLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsBlockLayout, "Main_Right", "100%", "en"); ContentBlockBase upcomingEventsBlock = new ContentBlockBase(); upcomingEventsBlock.Html = @"<h1>Upcoming events</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsBlock, "UpcomingEventsBlockLayout_Content", "Content block", "en"); #endregion #region Upcoming events image var upcomingEventsImageLayout = new LayoutControl(); var upcomingEventsImageLayoutColumns = new List<ColumnDetails>(); var upcomingEventsImageLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; upcomingEventsImageLayoutColumns.Add(upcomingEventsImageLayoutColumn1); upcomingEventsImageLayout.Layout = SampleUtilities.GenerateLayoutTemplate(upcomingEventsImageLayoutColumns, string.Empty); upcomingEventsImageLayout.ID = "UpcomingEventsImageLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsImageLayout, "Main_Right", "100%", "en"); ImageControl upcomingEventsImage = new ImageControl(); upcomingEventsImage.ImageId = SampleUtilities.GetLocalizedImageId("event", "en"); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsImage, "UpcomingEventsImageLayout_Content", "Image", "en"); #endregion #region Welcome block var welcomeBlockLayout = new LayoutControl(); var welcomeBlockLayoutColumns = new List<ColumnDetails>(); var welcomeBlockLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; welcomeBlockLayoutColumns.Add(welcomeBlockLayoutColumn1); welcomeBlockLayout.Layout = SampleUtilities.GenerateLayoutTemplate(welcomeBlockLayoutColumns, string.Empty); welcomeBlockLayout.ID = "WelcomeBlockLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), welcomeBlockLayout, "Main_Right", "100%", "en"); ContentBlockBase welcomeBlock = new ContentBlockBase(); Guid deanImageId = SampleUtilities.GetLocalizedImageId("dadean", "en"); //string deanImageUrl = SampleUtilities.GetLocalizedImageDefaultUrl("dadean", "en"); welcomeBlock.Html = string.Format(@"<h1>Welcome from the dean</h1> <p><img alt="""" src=""[images]{0}"" /><em>Welcome to Telerik International University. As dean of the university, I am proud of what we have to offer, and I am delighted that you are interested in learning more about us. Our region has a fascinating history, a creative arts community and fantastic recreational opportunities.</em><br /> <br /> </p>", deanImageId); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), welcomeBlock, "WelcomeBlockLayout_Content", "Content block", "en"); #endregion #region Photos block var photosBlockLayout = new LayoutControl(); var photosBlockLayoutColumns = new List<ColumnDetails>(); var photosBlockLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; photosBlockLayoutColumns.Add(photosBlockLayoutColumn1); photosBlockLayout.Layout = SampleUtilities.GenerateLayoutTemplate(photosBlockLayoutColumns, string.Empty); photosBlockLayout.ID = "PhotosBlockLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), photosBlockLayout, "Main_Right", "100%", "en"); ContentBlockBase photosBlock = new ContentBlockBase(); photosBlock.Html = @"<h1>Photos</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), photosBlock, "PhotosBlockLayout_Content", "Content block", "en"); #endregion #region Images view var photosGalleryLayout = new LayoutControl(); var photosGalleryLayoutColumns = new List<ColumnDetails>(); var photosGalleryLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; photosGalleryLayoutColumns.Add(photosGalleryLayoutColumn1); photosGalleryLayout.Layout = SampleUtilities.GenerateLayoutTemplate(photosGalleryLayoutColumns, string.Empty); photosGalleryLayout.ID = "PhotosGalleryLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), photosGalleryLayout, "Main_Right", "100%", "en"); ImagesView gallery = new ImagesView(); gallery.MasterViewName = "ImagesFrontendEducationThumbnailsListLightBox"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), gallery, "PhotosGalleryLayout_Content", "Images gallery", "en"); #endregion #region Announcements list var announcementsListLayout = new LayoutControl(); var announcementsListLayoutColumns = new List<ColumnDetails>(); var announcementsListLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 0), PlaceholderId = "Content" }; announcementsListLayoutColumns.Add(announcementsListLayoutColumn1); announcementsListLayout.Layout = SampleUtilities.GenerateLayoutTemplate(announcementsListLayoutColumns, string.Empty); announcementsListLayout.ID = "AnnouncementsListLayout"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), announcementsListLayout, "Main_Right", "100%", "en"); Telerik.Sitefinity.Modules.Lists.Web.UI.ListView announcements = new Telerik.Sitefinity.Modules.Lists.Web.UI.ListView(); announcements.Mode = ListViewMode.Expanded; announcements.SelectedListText = "Announcements"; announcements.SelectedListIds = string.Format(@"[""{0}""]", SampleConstants.AnnouncementsListId); announcements.CurrentMasterTemplateId = new Guid(SampleUtilities.GetControlTemplateKey(typeof(ExpandedListItemsMasterView), SampleConstants.EducationAnnouncementsTemplateName)); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), announcements, "AnnouncementsListLayout_Content", "List items", "en"); #endregion } result = SampleUtilities.CreateLocalizedPage(new Guid(SampleConstants.HomePageId), "Startseite", false, false, "de"); if (result) { SampleUtilities.SetTemplateToLocalizedPage(new Guid(SampleConstants.HomePageId), new Guid(SampleConstants.EducationTemplateId), "de"); var mainLayoutControl = new LayoutControl(); var mainLayoutColumns = new List<ColumnDetails>(); var mainLayoutColumn1 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 15, 0, 0), PlaceholderId = "Left" }; mainLayoutColumns.Add(mainLayoutColumn1); var mainLayoutColumn2 = new ColumnDetails() { ColumnSpaces = new ColumnSpaces(0, 0, 0, 15), PlaceholderId = "Right" }; mainLayoutColumns.Add(mainLayoutColumn2); mainLayoutControl.Layout = SampleUtilities.GenerateLayoutTemplate(mainLayoutColumns, string.Empty); mainLayoutControl.ID = "Main"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), mainLayoutControl, "content", "50% + 50% (custom)", "de"); //Lates news block ContentBlockBase latestNewsBlock = new ContentBlockBase(); latestNewsBlock.Html = @"<h1>Universitätsnachrichten</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNewsBlock, "Main_Left", "Content block", "de"); //Latest news view NewsView latestNews = new NewsView(); latestNews.MasterViewName = SampleConstants.EducationNewsSummaryContentViewName; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), latestNews, "Main_Left", "News", "de"); //Meet us image ImageControl meetUsImage = new ImageControl(); meetUsImage.ImageId = SampleUtilities.GetLocalizedImageId("besuchen", "de"); meetUsImage.CssClass = "sfimageWrp bottomImage"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), meetUsImage, "Main_Left", "Image", "de"); //Upcoming events ContentBlockBase upcomingEventsBlock = new ContentBlockBase(); upcomingEventsBlock.Html = @"<h1>Veranstaltungen</h1>"; SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsBlock, "Main_Right", "Content block", "de"); //Upcoming events image ImageControl upcomingEventsImage = new ImageControl(); upcomingEventsImage.ImageId = SampleUtilities.GetLocalizedImageId("event", "de"); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), upcomingEventsImage, "Main_Right", "Image", "de"); //Welcome block ContentBlockBase welcomeBlock = new ContentBlockBase(); Guid deanImageId = SampleUtilities.GetLocalizedImageId("dadean", "de"); welcomeBlock.Html = string.Format(@"<h1>Begrüßung des Dekans</h1> <p><img alt="""" src=""[images]{0}"" /><em>Herzlich willkommen auf die Telerik International University. Als Dekan der Universität bin ich stolz auf das, was wir zu bieten haben, und ich freue mich, dass Sie an weiteren Informationen über uns interessiert sind. Unsere Region hat eine faszinierende Geschichte, eine kreative Kunst Community und fantastische Möglichkeiten zur Freizeitgestaltung.</em><br /><br /></p>", deanImageId); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), welcomeBlock, "Main_Right", "Content block", "de"); Telerik.Sitefinity.Modules.Lists.Web.UI.ListView announcements = new Telerik.Sitefinity.Modules.Lists.Web.UI.ListView(); announcements.Mode = ListViewMode.Expanded; announcements.SelectedListText = "Announcements"; announcements.SelectedListIds = string.Format(@"[""{0}""]", SampleConstants.AnnouncementsListId); announcements.CurrentMasterTemplateId = new Guid(SampleUtilities.GetControlTemplateKey(typeof(ExpandedListItemsMasterView), SampleConstants.EducationAnnouncementsTemplateName)); SampleUtilities.AddControlToLocalizedPage(new Guid(SampleConstants.HomePageId), announcements, "Main_Right", "List items", "de"); } }