Exemplo n.º 1
0
 /// <summary>
 /// "Search" button is clicked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SearchBox_SearchList(object sender, HappyDog.SL.EventArguments.ListSearchArgs e)
 {
     if (e.InSearchMode == true)
     {
         MediasViewModel mediaViewModel = this.fromMediaLibray.DataContext as MediasViewModel;
         if (null != mediaViewModel && !string.IsNullOrEmpty(e.SearchText))
         {
             mediaViewModel.StartSearch(e.SearchText);
         }
     }
     else
     {
         // Back to none-search mode: re-attach the view model
         this.fromMediaLibray.DataContext = new MediasViewModel();
     }
 }
        // GET: Medias
        public ActionResult Medias(List <IPublishedContent> medias, int width = 0, int height = 0, string cssModifiers = null, string htmlAttributes = null, SliderViewModel sliderConfig = null)
        {
            var model = new MediasViewModel(medias, width, height);

            if (!string.IsNullOrEmpty(cssModifiers))
            {
                model.CssModifiers = cssModifiers;
            }

            if (!string.IsNullOrEmpty(htmlAttributes))
            {
                model.HtmlAttributes = htmlAttributes;
            }

            if (sliderConfig != null)
            {
                model.SliderConfig = sliderConfig;
            }

            return(PartialView("~/views/partials/medias/medias.cshtml", model));
        }
Exemplo n.º 3
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     this.rootPage          = MainPage.Current;
     medias                 = new MediasViewModel();
     MyListView.ItemsSource = medias.GetItems();
 }