Button Control does not work

<Canvasxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

<!--<Canvas.Triggers>

<EventTrigger RoutedEvent="Canvas.Loaded">

<BeginStoryboard>

<Storyboard BeginTime="0" Duration="Forever">

<DoubleAnimation Storyboard.TargetName="WhiteEllipse" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="300" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:1" RepeatBehavior="Forever"/>

</Storyboard>

</BeginStoryboard>

</EventTrigger>

</Canvas.Triggers>

<Ellipse x:Name="RedEllipse" Fill="red" Height="100" Width="100" />

<Ellipse x:Name="WhiteEllipse" Fill="#FFFFFFFF" Stroke="#FF000000" Width="100" Height="100" Canvas.Left="321" Canvas.Top="161.2"/>

<TextBlock x:Name="MyLink" Canvas.Left="0" Canvas.Top="0" FontFamily="Verdana" FontSize="12" Width="250" TextWrapping="Wrap" Text="some say on his days off he makes shoes for tiny little ants..." />-->

<ButtonHorizontalAlignment="Stretch"

Margin="57,37,48,111"

VerticalAlignment="Stretch"

Height="Auto"Width="Auto"

Grid.RowSpan="1"Grid.Column="0"

Grid.Row="0"Grid.ColumnSpan="1">

<DockPanelWidth="142.926143024619"

Height="90.5360416666667">

<TextBlockDockPanel.Dock="Bottom">

Here is the caption!

</TextBlock>

</DockPanel>

</Button>

</Canvas>

Pls look at my xaml file. I add button in to xaml but it does not work but ellipse and textblock can work.

Pls let me know what i miss in my xaml.

Thanks,

Alex

[5610 byte] By [Alex_SG] at [2008-3-1]
# 1

Hello.

I'm not sure, but I think you can't use the name Button.

Take a look at http://www.wynapse.com/Silverlight/Tutor/Silverlight_Buttons_and_Pushbuttton_Discussion.aspx

here is explained how an button is made.

I don't have time now to look at your xaml code, that's why I gave you a link, (I'm sorry. bussy)

bye.

(Take a look at the whole site. it is great stuff and helpfull)

gerard1234 at 2007-9-13 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Designer Issues...
# 2

Hi Alex...

Unfortunately, there is no "Button" object... so right off.. your <Button is not going to work.

The QuickStart has some examples of buttons, as does the sample project that comes with the VS2005 Silverlight project.

I'd say take a look at those, (and maybe my site)...

Keep asking questions... we all learn Smile

-Dave

WynApse at 2007-9-13 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Designer Issues...