0

I actually struggle to find a way to make a Image clickable or generate a Image Button in XAMl. There is even no Documentation on how to generate a Simple Image Button.

Tried to find Image Button. Tried to Use Button. Tried to Use Image. Tried to Use Image Icon. Image Button does not Exist. Button has no obvious way to put an Image on it. Image doesn't feature a click handler. Image Icon doesn't feature a click handler as well.

Even searching through google didn't bring any Idea, it looks like I'm the only Person who want to have an Image clickable. That's quite strange.

Does anybody has an Idea?

Thanks a lot in advance!

Best regards Eschmo

Update:

    <Grid x:Name="FeatureBar" >
     <Grid.ColumnDefinitions>
         <ColumnDefinition x:Name="FeatureBarLeftPaddingColumn" Width="10"/>
         <ColumnDefinition x:Name="LogFileAnalysis"/>
         <ColumnDefinition x:Name="FeatureBarRightPaddingColumn" Width="10"/>
     </Grid.ColumnDefinitions>

     <Image  x:Name="LogAnalyzerIcon" Grid.Column="1" Source="/Assets/logfileAnalyzerIcon.png" Width="50" Height="50" VerticalAlignment="Center" HorizontalAlignment="Left"/>
     <Button x:Name="Test" Width="50" Height="50" Grid.Column="1" />

 </Grid>
5
  • Button derives from ContentControl and inherits its Content property that you can set. Commented Jun 11 at 8:35
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jun 11 at 8:50
  • added xaml lines. not sure how that helps. I search for something not to be done programmatical i want to configure it in xaml. Commented Jun 11 at 13:23
  • In XAML this is simple: <Button ...><Image Source="/Assets/logfileAnalyzerIcon.png" ... /></Button>. Assuming this is using WinUI 3 you can install the WinUI 3 Gallery. This helps you navigate the different controls and learn how to use and customize them. You'll find the "image button" under "Basic input" -> "Button". Commented Jun 11 at 13:23
  • Thanks a lot! That immediately solved my question. Thanks a lot for the hint with UI3 Gallery. Will straight test it! thanks and best regards! Commented Jun 16 at 8:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.