2016-11-24 18 views
1

私はwpftoolkitライブラリのビジーインジケータを使用しています。これは私のコードです:ビジー状態のインジケータが透明

<Window x:Class="BusyControl.MainWindow"   
     xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" 
     xmlns:gif="http://wpfanimatedgif.codeplex.com" 
     mc:Ignorable="d" 
     Title="MainWindow" Height="350" Width="525"> 
    <Grid> 
     <xctk:BusyIndicator Name="ProgressIndicator" IsBusy="False" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"> 
      <xctk:BusyIndicator.BusyContentTemplate> 
       <DataTemplate> 
        <StackPanel> 
         <Image gif:ImageBehavior.AnimatedSource="Resources/loading.gif" Width="150" Height="50" /> 
         <TextBlock Text="{Binding ElementName=ProgressIndicator, Path=BusyContent}" HorizontalAlignment="Center" Margin="3"></TextBlock> 
        </StackPanel> 
       </DataTemplate> 
      </xctk:BusyIndicator.BusyContentTemplate> 
      <xctk:BusyIndicator.ProgressBarStyle> 
       <Style TargetType="ProgressBar"> 
        <Setter Property="Visibility" Value="Collapsed"/> 
       </Style> 
      </xctk:BusyIndicator.ProgressBarStyle> 
      <Grid> 
       <Button Content="Click me" Click="ButtonBase_OnClick" Width="100" Height="50"></Button> 
      </Grid> 
     </xctk:BusyIndicator> 
    </Grid> 
</Window> 

しかし、私のビジーインジケータは

before

のように見えますが、私はそれを行うことができますどのようにこの

After

のような透明ビジーインジケータが必要ですか?

+0

最初の問題は、グレーの一部が背景の色でマスクされていることです。最初の写真には、それが透明でないことが示唆されるものはありません。 – BugFinder

+0

wpftoolkitライブラリのソースでは、ContentPresenterの親要素が背景が灰色であることがわかりました。ソースの変更を除いて、この境界の背景を変更する方法はありますか? – user2455111

+0

[OK]を、私はこの記事[there](http://stackoverflow.com/questions/18984371/silvelight-busyindicator-background-color-for-the-message-box)で解決策を見つけました。自分のスタイルを使うことができます – user2455111

答えて

2

答えは、スタイリングまたはテンプレートの変更です。 Hereは、そのコントロールのテンプレートとスタイリングの変更を示す回答です。

もちろん、悪魔は詳細です...コントロールの構造が何であるかを具体的に調べ、それをどのようにスタイルするかを検討する必要があります。そして、もしあなたがこのようなことをやっていないのであれば、あなたがしなければならないことを解決するのに少し時間がかかるかもしれないというあなたの期待を管理すべきです。

関連する問題