2017-08-10 16 views
1

私はUWPのボタンを透明にしようとしていますが、backgroundプロパティを変更してもコントロールの色は変わりません。ツールバーのボタン?InkToolbar [UWP]の色を変更します

私は現在使用しているXAMLコードはこれです:

<InkToolbar x:Name="inkToolbar" TargetInkCanvas="{x:Bind inkCanvas}" HorizontalAlignment="Center" VerticalAlignment="Top" Background="Transparent"/> 
+0

背景をどのように設定していますか?コード内に関連するスニペットを表示してください。 –

答えて

1

最も簡単な方法は、あなたがより多くの制御をしたい場合は、あなたのApp.xaml

このような
<Application.Resources> 
    <SolidColorBrush x:Key="InkToolbarButtonBackgroundThemeBrush">Transparent</SolidColorBrush> 
</Application.Resources> 

にテーマの背景ブラシをオーバーライドすることで、すべてのボタンスタイルがBasedOnであるスタイルを含めることができます。

<Application.Resources> 
    <Style x:Key="InkToolbarCommonButtonStyle" 
      TargetType="ToggleButton"> 
     <Setter Property="MinWidth" 
       Value="{ThemeResource InkToolbarButtonWidth}" /> 
     <Setter Property="MinHeight" 
       Value="{ThemeResource InkToolbarButtonHeight}" /> 
     <Setter Property="MaxWidth" 
       Value="{ThemeResource InkToolbarButtonWidth}" /> 
     <Setter Property="MaxHeight" 
       Value="{ThemeResource InkToolbarButtonHeight}" /> 
     <Setter Property="BorderThickness" 
       Value="0" /> 
     <Setter Property="Background" 
       Value="Transparent" /> 
     <Setter Property="Foreground" 
       Value="{ThemeResource InkToolbarButtonForegroundThemeBrush}" /> 
     <Setter Property="FocusVisualMargin" 
       Value="-3" /> 
    </Style> 
</Application.Resources> 
関連する問題