title: Devexpress WPF tile long press open menu click navigate
body: <p>I have a TileLayoutControl that generates tiles from itessource</p>
  
  <pre><code>&lt;dxlc:TileLayoutControl ItemsSource="{Binding ProductsCategories}" TileClick="ProductsCategories_TileClick"&gt;
              &lt;dxlc:TileLayoutControl.Resources&gt;
                  &lt;Style TargetType="dxlc:Tile"&gt;
                      &lt;Setter Property="ContextMenu"&gt;
                          &lt;Setter.Value&gt;
                              &lt;ContextMenu&gt;
                                  &lt;MenuItem Header="TestItem"/&gt;
                              &lt;/ContextMenu&gt;
                          &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                      &lt;Setter Property="Height" Value="100"/&gt;
                      &lt;Setter Property="Width" Value="200"/&gt;
                      &lt;Setter Property="Margin" Value="20" /&gt;
                      &lt;Setter Property="Uid" Value="{Binding wcatsn}" /&gt;
                      &lt;Setter Property="Header"  Value="{Binding}" /&gt;
                      &lt;Setter Property="HeaderTemplate"&gt;
                          &lt;Setter.Value&gt;
                              &lt;DataTemplate&gt;
                                  &lt;TextBlock Text="{Binding wcatdescrEL}" Foreground="Black" FontFamily="Segoe UI Light" FontSize="12"/&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                      &lt;EventSetter Event="PreviewMouseDown" Handler="Tile_PreviewMouseDown" /&gt;
                  &lt;/Style&gt;
                  &lt;Style TargetType="dxlc:TileGroupHeader"&gt;
                      &lt;Setter Property="Foreground" Value="#FF000000" /&gt;
                  &lt;/Style&gt;
              &lt;/dxlc:TileLayoutControl.Resources&gt;
          &lt;/dxlc:TileLayoutControl&gt;
  </code></pre>
  
  <p>and I have a TileClick event that navigates my main frame (in witch the TileLayoutControl is into) to an other page.</p>
  
  <p>Now I also want to add an event so when i press a tile and keep it down after 5 seconds the context menu of the tile becomes enabled.</p>
  
  <p>I tried to achieve this with a PreviewMouseDown event but that way my TileClick event is not working. Whatever I do only the PreviewMouseDown event is getting triggered.</p>
  
  <pre><code>private System.Threading.AutoResetEvent _stopTrigger;
  
      private void Tile_PreviewMouseDown(object sender, MouseButtonEventArgs e)
      {
          var selectedTile = sender as DevExpress.Xpf.LayoutControl.Tile;
          string ButtonToProductsCategoriesViewEnabled = ButtonToProductsCategoriesView.Visibility.ToString();
  
  
          if (ButtonToProductsCategoriesViewEnabled != "Visible")
          {
              if (this._stopTrigger == null)
              {
                  this._stopTrigger = new System.Threading.AutoResetEvent(false);
              }
  
              if (!this._stopTrigger.WaitOne(5000))
              {
                  (selectedTile).ContextMenu.IsEnabled = true;
                  (selectedTile).ContextMenu.PlacementTarget = (selectedTile);
                  (selectedTile).ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
                  (selectedTile).ContextMenu.IsOpen = true;
              }
          }
      }
  </code></pre>