What shall be the code in xaml which makes a particular image to act as a button?
Posted
by Abhi
on Stack Overflow
See other posts from Stack Overflow
or by Abhi
Published on 2010-04-27T11:01:53Z
Indexed on
2010/04/27
11:03 UTC
Read the original article
Hit count: 268
Dear all
I am new to Silverlight. And i have to make a demo application where in designing is done by using Microsoft Expression Blend 2 and developing should be done using Visual Studio(c++).
Now i am first trying to become familiar with xaml files. So i was trying to make a simple demo where in i have to create a button and that button should be replace with an png image. In order to do so i tried with the mentioned below example. But i was not able to see anything in the screen.
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightApplication1.Page"
Width="640" Height="480">
<Grid x:Name="LayoutRoot" Background="White">
<Button x:Name="LogoutButton" >
<Button.Template>
<ControlTemplate>
<Image Source="SilverlightApplication1\bounce_photo.png" />
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
Please let me know where i am wrong and what shall i do to obtain the result.
With regards
Abhineet Agarwal
© Stack Overflow or respective owner