wsick / Fayde

Inspired by Silverlight; XAML engine using Javascript and rendering to the HTML5 Canvas.
MIT License
189 stars 27 forks source link

Button inside HyperlinkButton not working #239

Open deepaksm1 opened 8 years ago

deepaksm1 commented 8 years ago

If we are placing Button control inside HyperlinkButton control as a content (see below example). Button command or event does not work in Fayde. Same scenario works in silverlight.

<HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=FileUri}">

   <Button Height="32" Width="32" HorizontalAlignment="Right"
                                                  VerticalAlignment="Top"                                                  
                                                  Tag="Delete"                                                  
                                                  Command="{Binding Path=DeleteFileCommand}"
                                                  CommandParameter="{Binding }" />

  </HyperlinkButton>

Using fayde version:0.19.7

opcodewriter commented 8 years ago

Just checking, is the Uri given by FIleUri showing in the hyperlink?

opcodewriter commented 8 years ago

Why are you even using a Button inside a HyperlinkButton? It doesn't make sense.

deepaksm1 commented 8 years ago

I am showing file list using hyperlink button, After clicking on blue box file should be open in new window and want delete file button inside hyperlink blue box to delete file as shown in screenshot.

filelist

opcodewriter commented 8 years ago

I've never seen a UI where a button sits on top of another button.

Anyway, instead of having Button inside HyperlinkButton, why don't you create a Control which wraps the Hyperlink and the delete button? Something like this

<Grid>
     <HyperlinkButton />
      <Button Tag="Delete" VerticalAlignment="Top" HorizontalAlignement="Right"  />
</Grid>

Also, note you don't need to put Width and Height on the Button, because of the alignment it should take the icon image size.

deepaksm1 commented 8 years ago

Yes this is alternate solution, Thanks, but above scenario works in silverlight that's why I was trying it. Anyway I am going to implement your solution. Thanks.