public SideMenuControl() { InitializeComponent(); // Set the data context to dedicated view model DataContext = new SideMenuViewModel(); }
public ActionResult SideMenu() { SideMenuViewModel sideMenu = new SideMenuViewModel(); sideMenu.Courses = this.coursesService .GetAll() .OrderByDescending(c => c.CreatedOn) .Take(5) .To<CourseViewModel>() .ToList(); sideMenu.Specialties = this.specialtiesService .GetAll() .OrderByDescending(c => c.CreatedOn) .Take(5) .To<SpecialtyViewModel>() .ToList(); var trainerRole = this.usersService.GetRoles().FirstOrDefault(r => r.Name == RoleConstants.Trainer); if (trainerRole != null) { sideMenu.Trainers = this.usersService .GetAll() .Where(u => u.Roles.Any(r => r.RoleId == trainerRole.Id)) .OrderByDescending(c => c.CreatedOn) .Take(5) .To<UserViewModel>() .ToList(); } return this.PartialView("_SideMenu", sideMenu); }
public MenuWithSubMenuControl() { InitializeComponent(); //Binding our ViewModel with the datacontext to read the Menu & SubMenuItemsData DataContext = new SideMenuViewModel(); }
public ActionResult SideMenu() { SideMenuViewModel model = new SideMenuViewModel(); model.ProductCount = _productManager.GetCount(); model.CategoryCount = _categoryManager.GetCount(); return(PartialView("_SideMenu", model)); }
public SideMenu() { InitializeComponent(); Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false); Xamarin.Forms.NavigationPage.SetHasBackButton(this, false); On <Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true); BindingContext = sideMenuViewModel = new SideMenuViewModel(); }
public dynamic GetViewModel() { var sideMenuViewModel = new SideMenuViewModel(); sideMenuViewModel.Menu = productCategoryRepository.FindAllBy(productCategory => productCategory.Active && !productCategory.IdRootCategory.HasValue); FilterActiveChields(sideMenuViewModel); return(sideMenuViewModel); }
private void FilterActiveChields(SideMenuViewModel sideMenuViewModel) { sideMenuViewModel.Menu.ToList().ForEach(pc => { if (pc.ProductCategoryChields != null) { pc.ProductCategoryChields = pc.ProductCategoryChields.Where(c => c.Active).ToList(); } }); }
public MainPage() { InitializeComponent(); Detail = new NavigationPage(new TabbedPage1()); NavigationPage.SetHasNavigationBar(this, true); viewModel = new SideMenuViewModel(); BindingContext = viewModel; }
public PartialViewResult SideMenu(string activeMenu = "") { var model = new SideMenuViewModel() { SideMenu = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("SideMenu", AbpSession.ToUserIdentifier())), ActiveMenuItemName = activeMenu }; return(PartialView("_SideMenu", model)); }
public SideMenuView() { DataContext = new SideMenuViewModel(); var stackPanel = new StackPanel(); AddSortButton(stackPanel); AddSortPropertiesChooser(stackPanel); Content = stackPanel; }
public IActionResult Index() { var sideMenu = new SideMenuViewModel(); var response = _jokeGeneratorService.GetCategories(); if (response.Result.IsSuccess) { sideMenu.Categories = response.Result.Result; } return(View(sideMenu)); }
public PartialViewResult SideMenu(string currentPageName = "") { var isGrantedPermission = PermissionChecker.IsGranted(AbpSession.ToUserIdentifier(), UserPermissions.User); var model = new SideMenuViewModel { MainMenu = AsyncHelper.RunSync(() => _userNavigationManager.GetMenuAsync("Mpa", AbpSession.ToUserIdentifier())), CurrentPageName = currentPageName }; return(PartialView("_SideMenu", model)); }
public object CreateViewModel(DependencyObject sender) { var vm = new SideMenuViewModel(); /*if (Designer.IsDesignMode) * vm.ServiceLocator.RegisterServiceObject<ISideMenuDataAccess>(new ModelsDesignTime.DesignTimePeopleDataAccess()); * else * vm.ServiceLocator.RegisterServiceObject<ISideMenuDataAccess>(new SideMenuDataAccess());*/ vm.ServiceLocator.RegisterServiceObject <ISideMenuDataAccess>(new SideMenuDataAccess()); return(vm); }
public ActionResult Index() { var model = new SideMenuViewModel { Title = "Top Weekly Sellers" }; var _StartDate = DateTime.Now; var _EndDate = DateTime.Now; var c = DateTime.Now; CalculateDates(c, ref _StartDate, ref _EndDate); model.Items = LoadProducts(_StartDate, _EndDate); return(View(model)); }
// // GET: /ContentBlocks/TopWeeklySellers/ public ActionResult Index(ContentBlock b) { SideMenuViewModel model = new SideMenuViewModel(); model.Title = "Top Weekly Sellers"; DateTime _StartDate = DateTime.Now; DateTime _EndDate = DateTime.Now; System.DateTime c = DateTime.Now; CalculateDates(c, _StartDate, _EndDate); model.Items = LoadProducts(_StartDate, _EndDate); return(View(model)); }
public ActionResult SideMenu() { ProductManager _productManager = new ProductManager(); CategoryManager _categoryManager = new CategoryManager(); CustomerManager _customerManager = new CustomerManager(); SupplierManager _supplierManager = new SupplierManager(); SideMenuViewModel model = new SideMenuViewModel(); model.ProductCount = _productManager.GetCount(); model.CategoryCount = _categoryManager.GetCount(); model.CustomerCount = _customerManager.GetCount(); model.SupplierCount = _supplierManager.GetCount(); return(PartialView("_SideMenu", model)); }
public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block) { SideMenuViewModel model = new SideMenuViewModel(); model.Title = "Top Weekly Sellers"; DateTime _StartDate = DateTime.Now; DateTime _EndDate = DateTime.Now; System.DateTime c = DateTime.Now; CalculateDates(c, _StartDate, _EndDate); model.Items = LoadProducts(app, _StartDate, _EndDate); model.Title = "Top Sellers"; return(RenderModel(model)); }
/// <summary> /// ctor(). /// </summary> public SideMenuView() { InitializeComponent(); int wd = DependencyService.Get <IDisplaySize>().GetWidthDiP(); WidthRequest = wd * 0.65; MenuOrientations = MenuOrientation.LeftToRight; IsFullScreen = true; AnimationDurationMillisecond = 250; BackgroundViewColor = GetPlatformColor(); BackgroundColor = Color.FromHex("#ffffff"); BindingContext = _viewModel = new SideMenuViewModel(); }
public string RenderModel(SideMenuViewModel model) { StringBuilder sb = new StringBuilder(); sb.Append("<div class=\"sidemenu topsellers\">"); sb.Append("<div class=\"decoratedblock\">"); sb.Append("<h3>" + HttpUtility.HtmlEncode(model.Title) + "</h3>"); sb.Append("<ol>"); foreach (var item in model.Items) { sb.Append("<li><a href=\"" + item.Url + "\" title=\"" + HttpUtility.HtmlEncode(item.Title) + "\">" + HttpUtility.HtmlEncode(item.Name) + "</a></li>"); } sb.Append("</ol>"); sb.Append("</div>"); sb.Append("</div>"); return(sb.ToString()); }
private static void MenuMapRoute(RouteCollection routes) { SideMenuService menuService = new SideMenuService(new GenericRepository <ProductCategory>()); SideMenuViewModel sideMenuViewModel = menuService.GetViewModel(); foreach (var menu in sideMenuViewModel.Menu) { foreach (var item in menu.ProductCategoryChields) { routes.MapRoute( name: string.Format("{0}{1}", item.RootCategory.Name, item.Name), url: string.Concat(item.RootCategory.NameForRoute, "/{nameCategory}/{searchText}"), defaults: new { controller = "Home", action = "Index", nameRootCategory = item.RootCategory.Name, nameCategory = UrlParameter.Optional, SearchText = UrlParameter.Optional }); } ; } ; }
public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block) { SideMenuViewModel model = new SideMenuViewModel(); if (block != null) { model.Title = block.BaseSettings.GetSettingOrEmpty("Title"); List <ContentBlockSettingListItem> links = block.Lists.FindList("Links"); if (links != null) { foreach (ContentBlockSettingListItem l in links) { model.Items.Add(AddSingleLink(l)); } } } return(RenderModel(model)); }
// // GET: /ContentBlocks/SideMenu/ public ActionResult Index(ContentBlock block) { SideMenuViewModel model = new SideMenuViewModel(); if (block != null) { model.Title = block.BaseSettings.GetSettingOrEmpty("Title"); List <ContentBlockSettingListItem> links = block.Lists.FindList("Links"); if (links != null) { foreach (ContentBlockSettingListItem l in links) { model.Items.Add(AddSingleLink(l)); } } } return(View(model)); }
// // GET: /ContentBlocks/Top10Products/ public ActionResult Index(ContentBlock b) { SideMenuViewModel model = new SideMenuViewModel(); System.DateTime s = new System.DateTime(1900, 1, 1); System.DateTime e = new System.DateTime(3000, 12, 31); List <Product> products = MTApp.ReportingTopSellersByDate(s, e, 10); foreach (Product p in products) { SideMenuItem item = new SideMenuItem(); item.Title = p.ProductName; item.Name = p.ProductName; item.Url = UrlRewriter.BuildUrlForProduct(p, MTApp.CurrentRequestContext.RoutingContext, string.Empty); item.Name += " - " + p.SitePrice.ToString("C"); model.Items.Add(item); } model.Title = "Top Sellers"; return(View(model)); }
public ActionResult SideMenu() { var user = Mapper.Map <UserViewModel>(this.UserProfile); var partners = this.Organizations.GetPartners(this.UserProfile.OrganizationId ?? 0) .Project() .To <PartnersViewModel>() .ToList(); var categories = this.Categories.GetAll() .Project() .To <CategoryViewModel>() .ToList(); var model = new SideMenuViewModel { Partners = partners, UserViewModel = user, Categories = categories }; return(this.PartialView("_SideMenuPartial", model)); }
public string Render(MerchantTribe.Commerce.MerchantTribeApplication app, dynamic viewBag, MerchantTribe.Commerce.Content.ContentBlock block) { SideMenuViewModel model = new SideMenuViewModel(); System.DateTime s = new System.DateTime(1900, 1, 1); System.DateTime e = new System.DateTime(3000, 12, 31); List <Product> products; products = app.ReportingTopSellersByDate(s, e, 10); foreach (Product p in products) { SideMenuItem item = new SideMenuItem(); item.Title = p.ProductName; item.Name = p.ProductName; item.Url = UrlRewriter.BuildUrlForProduct(p, app.CurrentRequestContext.RoutingContext, string.Empty); item.Name += " - " + p.SitePrice.ToString("C"); model.Items.Add(item); } model.Title = "Top Sellers"; return(RenderModel(model)); }
public string RenderModel(SideMenuViewModel model) { StringBuilder sb = new StringBuilder(); sb.Append("<div class=\"sidemenu\">"); sb.Append("<div class=\"decoratedblock\">"); sb.Append("<h4>" + HttpUtility.HtmlEncode(model.Title) + "</h4>"); sb.Append("<ul>"); foreach (var item in model.Items) { sb.Append("<li><a href=\"" + item.Url + "\" class=\"" + HttpUtility.HtmlEncode(item.CssClass) + "\" title=\"" + HttpUtility.HtmlEncode(item.Title)); if (item.OpenInNewWindow == true) { sb.Append(" target=\"_blank\""); } sb.Append("\">" + HttpUtility.HtmlEncode(item.Name) + "</a></li>"); } sb.Append("</ul>"); sb.Append("</div>"); sb.Append("</div>"); return(sb.ToString()); }
public ActionResult Index() { var model = new SideMenuViewModel(); var s = new DateTime(1900, 1, 1); var e = new DateTime(3000, 12, 31); List <Product> products; products = HccApp.ReportingTopSellersByDate(s, e, 10); foreach (var p in products) { var item = new SideMenuItem { Title = p.ProductName, Name = p.ProductName, Url = UrlRewriter.BuildUrlForProduct(p) }; item.Name += " - " + p.SitePrice.ToString("C"); model.Items.Add(item); } model.Title = "Top Sellers"; return(View(model)); }
public SideMenu() { this.InitializeComponent(); DataContext = new SideMenuViewModel(); }
public SideMenuControl() { InitializeComponent(); DataContext = new SideMenuViewModel(); }
public PartialViewResult SideBar() { SideMenuViewModel sideMenuViewModel = menuService.GetViewModel(); return(PartialView("_SideBar", sideMenuViewModel)); }
private void Storyboard_Completed(object sender, EventArgs e) { SideMenuViewModel viewModel = this.DataContext as SideMenuViewModel; viewModel.CloseMenu.Execute(null); }