2つの質問があります。
1日 Windows Embedded Compact 7にSilverlightを使用していますが、バインディングに問題があります。
私はこのようなテンプレートを持っています
<Style TargetType="RadioButton" x:Key="VoltageTab">
<Setter Property="Width" Value="95"/>
<Setter Property="Height" Value="61"/>
<Setter Property="Margin" Value="193,0,192,3"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#00000000">
<Image x:Name="UnCheckedimg" Source="12.png"/>
<Image x:Name="Checkedimg" Visibility="Collapsed" Source="11.png"/>
<TextBlock x:Name="ModeName" FontSize="20" FontFamily="Alternate_Gothic_No.ttf#Alternate-Gothic-No3" Text="VOLTAGE" Foreground="#D25A32" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,4,0,0" />
<TextBlock x:Name="ModeValue" FontSize="20" FontFamily="Alternate_Gothic_No.ttf#Alternate-Gothic-No3" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,2"/>
<TextBlock x:Name="ModeNameChecked" Visibility="Collapsed" FontSize="34" FontFamily="Alternate_Gothic_No.ttf#Alternate-Gothic-No3" Text="VOLTAGE" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
TemplateBindingを使用してModeValueテキストブロックをバインドしていますが、ModeNameをバインドするには別のバインドが必要です。誰かが私にこれを行う方法を教えてもらえますか?
私は別のスタイルを持っています
編集:編集者が私にそれをここに投稿することを許可しなかったので、2番目のスタイルは以下に投稿されます
コンテンツにテキストを入れるだけなら問題ありませんが、オブジェクトを実行して、ボタン内のテキストをフォーマットできるようにします。
これは可能ですか?そうでない場合、これを達成する他の方法はありますか?
私はSilverlightForWindows組み込みを使用していることに注意してください。
よろしく、ルカ
<Style x:Key="FunctionSelectButton" TargetType="RadioButton">
<Setter Property="Width" Value="154"/>
<Setter Property="Height" Value="61"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#00000000">
<Image x:Name="NormalImg" Source="mode_unpressed.png" Stretch="None"/>
<TextBlock x:Name="NormalText" Foreground="#D25A32" FontSize="26" FontFamily="Alternate_Gothic_No.ttf#Alternate-Gothic-No3" HorizontalAlignment="Center" Text="{TemplateBinding Content}" VerticalAlignment="Center" Margin="0,0,0,0"></TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
表現しやすい画像->