public static ConnectCommand Create(CommandContent model) { return(new ConnectCommand() { ContentT = model }); }
public GetUriResponse?GetUri(CommandContent commandContent) { if (commandContent is SimpleContentCommand uri) { return(Commands.Get(uri.Command)); } return(null); }
public GetUriResponse?GetUri(CommandContent commandContent) { if (commandContent is AssetGoCommand command) { return("/View/Asset/AssetLanding.xaml?" + command.Asset.ShortCode); } return(null); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data. var commandInformation = (string)e.NavigationParameter; commandName = commandInformation.Substring(4); string commandClass = commandInformation.Substring(0, 4); CommandName.Text = commandName; CommandContent.Navigate(new Uri("ms-appx-web:///Commands/" + commandClass + "/" + commandName + ".html")); checkIfFavorite(); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/>. /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data. //var command = (Command)e.NavigationParameter; //CommandName.Text = command.CommandName; //string commandSource = "ms-appx-web:///Commands/" + command.ClassName + "/" + command.CommandName + ".html"; //CommandContent.Navigate(new Uri(commandSource)); CommandName.Text = "ar"; CommandContent.Navigate(new Uri("ms-appx-web:///Commands/" + "bfys" + "/ar" + ".html")); }
public bool Check(CommandContent content) { if (content.AlexaCommandContent?.IntentName != null) { return(IntentName == content.AlexaCommandContent.IntentName); } if (Slots == null || content.AlexaCommandContent?.Slots == null) { return(false); } return(content.AlexaCommandContent.Slots.Keys.All(key => Slots.ContainsKey(key))); }
public StarViewModel(DocumentPaneViewModel paneVm) { _paneVm = paneVm; _context = UserContext.Current; _paneCommand = _paneVm.GetPageCommand(); _messenger.RegisterAsync <BookmarkHasChangedMessage>(this, _context.Token, SetBookmarkedState); _messenger.RegisterAsync <BookmarkStatusResponseMessage>(this, _context.Token, SetBookmarkedState); _messenger.SendAsync <BookmarkStatusRequestMessage>(new BookmarkStatusRequestMessage(_paneCommand), _context.Token); ClickBookmarkCommand = new RelayCommand(() => { //IsBookmarked responds to clicks, and will be reflect that after-clicked state. _messenger.SendAsync(new BookmarkSetMessage(_paneCommand, IsBookmarked), _context.Token); }); IsEnabled = true; }
protected BookmarkMessageBase(CommandContent bookmark, bool isBookmarked) { Bookmark = bookmark; IsBookmarked = isBookmarked; }
public BookmarkStatusRequestMessage(CommandContent bookmark) { Bookmark = bookmark; }
public BookmarkHasChangedMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked) { }
public BookmarkStatusResponseMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked) { }
private void Parse() { this.commandNameEndIndex = this.GetCommandNameEndIndex(); this.Name = this.ParseName(); this.Parameters = this.ParseParameters(); this.TrimParams(); this.Type = this.ParseCommandType(this.Name); }
public BookmarkSetMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked) { }
public bool Check(CommandContent content) { return(content.AliceCommandContent?.Keywords != null && Utils.CheckTokens(Tokens, content.AliceCommandContent.Keywords.ToArray())); }