title: Xamarin Forms: How to make dynamically created items clickable?
body: <p>In my application I am adding menu items dynamically.</p>
  <p>Is it possible to make items clickable so that it can take me to, for example, &quot;Page2&quot; or &quot;Page3&quot;?</p>
  <p>Here is my code in <strong>AppShell.xaml.cs</strong></p>
  <pre><code>public ObservableCollection&lt;dynamic&gt; FlyoutItems { get; set; }
  
  public AppShell()
  {
              FlyoutItems = new ObservableCollection&lt;dynamic&gt;()
              {
                  new {  MenuTitle=&quot;MenuTitle1&quot; },
                  new {  MenuTitle=&quot;MenuTitle2&quot; },
                  new {  MenuTitle=&quot;MenuTitle3&quot; },
                  new {  MenuTitle=&quot;MenuTitle4&quot; }
              };
              InitializeComponent();
              BindingContext = this;
  }
  </code></pre>
  <p><strong>AppShell.xaml</strong></p>
  <pre><code>&lt;Shell.FlyoutContentTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackLayout&gt;
                  &lt;ListView x:Name=&quot;MenuItemsListView&quot;
                            SeparatorVisibility=&quot;None&quot;
                            HasUnevenRows=&quot;true&quot;
                            ItemsSource=&quot;{Binding FlyoutItems}&quot;&gt;
                      &lt;ListView.Header&gt;
                          &lt;Grid BackgroundColor=&quot;CornflowerBlue&quot;&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition Width=&quot;10&quot;/&gt;
                                  &lt;ColumnDefinition Width=&quot;*&quot;/&gt;
                                  &lt;ColumnDefinition Width=&quot;10&quot;/&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height=&quot;30&quot;/&gt;
                                  &lt;RowDefinition Height=&quot;80&quot;/&gt;
                                  &lt;RowDefinition Height=&quot;Auto&quot;/&gt;
                                  &lt;RowDefinition Height=&quot;10&quot;/&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Label Grid.Row=&quot;2&quot; Grid.Column=&quot;1&quot;
                                     TextColor=&quot;#d7d9b4&quot;
                                     Text=&quot;{Binding Title}&quot;
                                     FontSize=&quot;24&quot;/&gt;
                          &lt;/Grid&gt;
                      &lt;/ListView.Header&gt;
                      &lt;ListView.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;ViewCell&gt;
                                  &lt;StackLayout Padding=&quot;15,10&quot;
                                               HorizontalOptions=&quot;FillAndExpand&quot;&gt;
                                      &lt;Label VerticalOptions=&quot;FillAndExpand&quot;
                                             VerticalTextAlignment=&quot;Center&quot;
                                             Text=&quot;{Binding Type}&quot;
                                             TextColor=&quot;Black&quot;
                                             FontSize=&quot;20&quot;/&gt;
                                  &lt;/StackLayout&gt;
                              &lt;/ViewCell&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListView.ItemTemplate&gt;
                  &lt;/ListView&gt;
              &lt;/StackLayout&gt;
          &lt;/DataTemplate&gt;
      &lt;/Shell.FlyoutContentTemplate&gt;
  </code></pre>
  <p>I think I need to create a button but  I am not quite sure how to do it.</p>
  <p>Hope someone can help.</p>
  <p>Thanks!</p>