2011-07-20 23 views
0

特定のメソッドを呼び出すには私のSilverlightボタンが必要ですが、ボタンにはクリックプロパティはありません。インテリセンスは「clickmode」を示していないが、何が、私は間違いなくボタン(銀色の中)にはClickプロパティがありません

はここでXAMLファイル

<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Telerik_Windows_Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" x:Class="..." 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="400"> 

    <Grid x:Name="LayoutRoot" Background="White"> 

     <Telerik_Windows_Controls:RadChart Name="radChart" Content="RadChart" Margin="78,47,0,0" d:LayoutOverrides="Width, Height"/> 


    </Grid> 
    <Button Content="Button" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="75"/> 
</UserControl> 

答えて

1

A WPFボタンの私のコードですSystem.Windows.Controls.Buttonコントロールを使用してい

を「クリック」 「OnClick」イベントまたは「コマンド」プロパティを有する。あなたは、このリンクが役立つことがあります。WPF Commanding Overview

0

シルバーのButtonMSDN API documentationを参照してください、ButtonBaseで定義されたClickというイベントを、持っていません。だから、のようなXAMLを書くかもしれません:

<Button Content="Button" ... Click="My_Event_Handler"/> 

しかし、物事を行うには、「素敵な」方法(Button's Command property)のための他の回答で参照されるようコマンディングを見てみましょう。

関連する問題