我的程序中有以下 XAML
<Border x:Name="topCornerBorder" CornerRadius="10" Height="auto" Width="auto" Background="White">
<Grid x:Name="topCorner" Grid.Row="0" Grid.Column="0" Background="White" Margin="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="190*"/>
<ColumnDefinition Width="30*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="270*"/>
<RowDefinition Height="60*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="StackPanel" Orientation="Vertical" Grid.Row="0" Grid.Column="1" >
<Canvas x:Name="textBlockCanvas1">
</Canvas>
</StackPanel>
<Canvas Grid.Row="1" Grid.Column="0" >
<sdk:DataGrid x:Name="dataGrid" Grid.Row="1" Grid.Column="0" Height="50" Width="300" Canvas.Top="15" Canvas.Left="100" Visibility="Collapsed" AutoGenerateColumns="False" ColumnWidth="*" RowBackground="Aqua"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" CanUserResizeColumns="false" CanUserSortColumns="False" IsReadOnly="True" BorderThickness="3"
CanUserReorderColumns="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<sdk:DataGrid.Columns>
<!--Column stuff here not important for this question..-->
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</Canvas>
</Grid>
我尝试通过执行以下操作来设置过渡:
<telerik:RadTransitionControl Name="radTransitionControl" Duration="00:00:01" Content="{Binding topCornerBorder}" >
<telerik:RadTransitionControl.Transition >
<telerik:SlideAndZoomTransition/>
</telerik:RadTransitionControl.Transition>
</telerik:RadTransitionControl>
但什么都没有发生。我还在后面的 C# 代码中尝试了以下内容:
radTransitionControl.Content = this.topCornerBorder;
但这会导致错误“值不在预期范围内”。
我必须做些什么才能成功地将过渡内容属性设置为围绕我的其余 UI 元素的边框?