public MainDesignViewModel() { Menu = new VisualMenu { Groups = new ObservableCollection<VisualGenericGroup> { new VisualGenericGroup { Title = AppResourcesHelper.GetString("LBL_NEWS") }, new VisualGenericGroup { Title = AppResourcesHelper.GetString("LBL_BUREAU") }, new VisualGenericGroup { Title = AppResourcesHelper.GetString("LBL_PROJECTS") }, new VisualGenericGroup { Title = AppResourcesHelper.GetString("LBL_CONFERENCES") }, new VisualGenericGroup { Title = AppResourcesHelper.GetString("LBL_SALONS") } } }; SelectedItem = Menu.Groups[0].Items[0]; }
/// <summary> /// Constructor. Resolve IoC dependencies, create the menu and the commands /// </summary> public MainViewModel() { // Resolve Ioc dependencies using (ILifetimeScope scope = ViewModelLocator.Container.BeginLifetimeScope()) { _modelConference = scope.Resolve<IReadableLimitable<Conference>>(); _modelMember = scope.Resolve<IReadableMember>(); _modelNews = scope.Resolve<IReadableLimitable<News>>(); _modelConference = scope.Resolve<IReadableLimitable<Conference>>(); _modelProject = scope.Resolve<IReadableLimitable<Project>>(); _modelShow = scope.Resolve<IReadableLimitable<Show>>(); } // Create the menu Menu = new VisualMenu { Groups = new ObservableCollection<VisualGenericGroup> { new VisualGenericGroup {Title = AppResourcesHelper.GetString("LBL_NEWS")}, new VisualGenericGroup {Title = AppResourcesHelper.GetString("LBL_BUREAU")}, new VisualGenericGroup {Title = AppResourcesHelper.GetString("LBL_PROJECTS")}, new VisualGenericGroup {Title = AppResourcesHelper.GetString("LBL_CONFERENCES")}, new VisualGenericGroup {Title = AppResourcesHelper.GetString("LBL_SALONS")} } }; // Create commands LoadMenuCommand = new AsyncDelegateCommand(LoadMenuAsync); LoadMoreItemsCommand = new AsyncDelegateCommand<string>(LoadMoreItemsAsync); GoToMasterPageCommand = new RelayCommand<VisualGenericGroup>(GoToMasterPage); GoToDetailsPageCommand = new RelayCommand<VisualGenericItem>(GoToDetailsPage); GoToAboutPageCommand = new RelayCommand<object>(GoToAboutPage); GoToSocialPageCommand = new RelayCommand<Uri>(GoToSocialNetworkPage); PinCommand = new RelayCommand<PinnableObject>(Pin); }
/// <summary> /// Launch the search /// </summary> /// <param name="keyword">Search keywords</param> private async Task SearchAsync(string keyword) { Keywords = keyword; Results = new VisualMenu { Groups = new ObservableCollection<VisualGenericGroup>() }; await SearchNewsAsync(); await SearchConferencesAsync(); await SearchShowsAsync(); }