0
我正嘗試使用工具包中的Silverlight繁忙指示器控件,並將自己的自定義模板應用於UI。爲XAML代碼看起來像這樣Silverlight忙碌指示器定製者模板
<UserControl x:Class="CustomBusyIndicator.MainPage"
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"
xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:ed="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<controlsToolkit:BusyIndicator IsBusy="True"
BusyContent="{Binding}" Margin="0,0,0,0" >
<!-- Provide custom UI for busy display -->
<controlsToolkit:BusyIndicator.BusyContentTemplate>
<DataTemplate >
<StackPanel Width="307" Height="32">
<Grid x:Name="LayoutRoot" Background="#8EBD40" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="73"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Canvas Width="30" Height="30" Grid.Column="0">
<ed:Arc ArcThickness=".7" ArcThicknessUnit="Pixel" EndAngle="360" Stretch="None" Stroke="White" StartAngle="90" Fill="White" UseLayoutRounding="False" Width="30" Height="30"/>
<Canvas.RenderTransform>
<RotateTransform x:Name="SpinnerRotate" Angle="0" CenterX="15" CenterY="15" />
</Canvas.RenderTransform>
<Canvas.Triggers>
<EventTrigger RoutedEvent="ContentControl.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SpinnerRotate"
Storyboard.TargetProperty="(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:01"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Canvas.Triggers>
</Canvas>
<TextBlock Grid.Column="1" FontWeight="Thin" FontSize="25" Foreground="White" FontFamily="Verdana" VerticalAlignment="Center" HorizontalAlignment="Center">Uploading....</TextBlock>
</Grid>
</StackPanel>
</DataTemplate>
</controlsToolkit:BusyIndicator.BusyContentTemplate>
<!-- Remove unnecessary default ProgressBar -->
<controlsToolkit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</controlsToolkit:BusyIndicator.ProgressBarStyle>
<!-- Content goes here... -->
</controlsToolkit:BusyIndicator>
</UserControl>
一切似乎都很正常,只是,有它周圍的內容模板出現灰色邊框。有什麼方法可以被覆蓋嗎?