Note that there are some explanatory texts on larger screens.

plurals
  1. POAttach Command property to other control than Button in MVVM Cross
    primarykey
    data
    text
    <p>I was wondering if there's a way to attach the Command property to let's say a HubTile (from the Windows Phone Toolkit), my code looks something like this:</p> <pre><code> &lt;tk:HubTile Size="Large" Grid.ColumnSpan="4" Margin="6" Name="hubTileFriends" Title="{Binding GlobalResources.AppResources.MainPage_Tile_Friends}"/&gt; </code></pre> <p>I want to navigate to another Page when i tap this HubTile and while I was looking at the MVVM Cross examples, the only way to navigate to another Page, is by using a Command on the View's (Page) ViewModel, something like this: </p> <pre><code>public ICommand Navigate { get { return new MvxCommand(()=&gt; ShowViewModel&lt;FriendsViewModel&gt;()); } } </code></pre> <p>So that means I should have a button somewhere on my MainPage looking like this:</p> <pre><code>&lt;Button Command="{Binding Navigate"/&gt; </code></pre> <p>Question is, can I navigate to another page without using Command and making something in the page's code behind or can I attach that Command property to my HubTile? Thx in advance</p> <p>UPDATE</p> <pre><code>&lt;tk:HubTile Size="Large" Grid.ColumnSpan="4" Margin="6" Name="btnFriends" Title="{Binding GlobalResources.AppResources.MainPage_Tile_Friends}"&gt; &lt;i:Interaction.Triggers&gt; &lt;i:EventTrigger EventName="Tap"&gt; &lt;cmd:MvxEventToCommand Command="{Binding Navigate}"/&gt; &lt;/i:EventTrigger&gt; &lt;/i:Interaction.Triggers&gt; &lt;/tk:HubTile&gt; </code></pre> <p>This made it, Visual Studio kept telling me that something was wrong with the version, looked for other places or solutions to fixed that, but out of nowhere, the error disappeeared.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload