0
カスタムシルバーボタンを作成しています。私は視覚的な状態を取得したいので、私はスタイルや制御テンプレートを使用したくありません。ですから、私は次のように書いています:スタイルを使用せずにシルバーライトでカスタムボタンを作成する
<Button x:Class="MyNameSpace.MyImageButton"
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"
mc:Ignorable="d">
<Grid x:name="LayoutRoot">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup ...
</VisualStateGroup>
<VisualStateManager.VisualStateGroups>
<Border (Various border styles)
<StackPanel x:Name="ContentPresenter" Orientation="Horizontal">
<Image Source="{Binding Path=this.ImageSource}" Stretch="Fill" />
<!--ContentPresenter-->
<ContentPresenter HorizontalAlignment="{Binding Path=this.HorizontalContentAlignment}"
VerticalAlignment="{Binding Path=this.VerticalContentAlignment}" >
<TextBlock Text="{Binding Path=this.Content}" />
</ContentPresenter>
</StackPanel>
</Border>
</Grid>
<Button.BorderBrush>
.....
<Button.BorderBrush>
</Button>
しかし、スタイリングはうまくいかないようです。デフォルトのボタンスタイルが表示されます。それを動作させる方法。 Image sourceプロパティも登録しました。それも機能していないようです。
助けてください。前もって感謝します。
これに関する情報がある場合は、この点についてご意見ください。 –