0
이제 맞춤형 실버 라이트 버튼을 하나 만들고 있습니다. 시각 상태를 가져 오려면 스타일이나 컨트롤 템플릿을 사용하고 싶지 않습니다. 그래서 저는 다음과 같이 작성했습니다 :스타일을 사용하지 않고 Silverlight에서 사용자 정의 버튼 만들기
<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>
하지만 스타일이 제대로 작동하지 않는 것 같습니다. 기본 단추 스타일을 보여줍니다. 어떻게 작동하게 만드는지. 이미지 소스 속성도 등록했습니다. 그것도 작동하지 않습니다.
도와주세요. 미리 감사드립니다.
이에 대한 의견이 있으시면 언제든지 문의 해주십시오. –