0
我有一個ProgressbarStyle,我在其中添加一個TextBlock-Control到網格「DeterminateRoot」。這個TextBlock應該顯示一個狀態文本,我在CodeBehind中手動更改,這已經可以工作了。ProgressbarStyle問題
這裏是我的風格,我的標準ProgressbarStyle改變部分:
<Grid x:Name="DeterminateRoot" Margin="1"> <Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Margin="{TemplateBinding BorderThickness}" RadiusY="1.5" RadiusX="1.5" StrokeThickness="0.5"/> <TextBlock x:Name="txtbStatusText" Text="5 of 20" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" FontWeight="Bold" FontFamily="Arial" FontSize="11"></TextBlock> </Grid>
我的問題是:我怎樣才能改變TextBlock的文本爲黑色的把ForegroundColor,不改變進度條的標準顏色?因爲,當我刪除矩形(ProgressBarIndicator)的Fill-Property時,我可以更改TextBlock的ForegroundColor,但我想保留Progressbar的標準視圖!
非常感謝您的回答!
問候 Dougy