我需要將數據綁定到我的自定義類中的一個元素。我已經通過附加屬性將ItemSource作爲telerik:RadTransitionControl的ObservableCollection。但是,我需要提供圖像成員作爲Image控件的源代碼。我嘗試了以下方法,但未成功。提供圖像控件的源代碼
<Grid Background="Black">
<telerik:RadTransitionControl x:Name="radControl" adRotator:AdRotatorExtensions.ItemChangeDelay="0:0:3"
adRotator:AdRotatorExtensions.CurrentSelectedIndex="0"
adRotator:AdRotatorExtensions.IndexChanged="{Binding TopItemCommand, Mode=OneWay}"
adRotator:AdRotatorExtensions.ItemsSource="{Binding Path=ImagePaths}"
VerticalAlignment="Center"
HorizontalAlignment="Center" Width="650">
<telerik:RadTransitionControl.Transition>
<telerik:MotionBlurredZoomTransition />
</telerik:RadTransitionControl.Transition>
<telerik:RadTransitionControl.ContentTemplate>
<DataTemplate>
<Image Source="{Binding Path=ImagePaths.AdImage}" />
</DataTemplate>
</telerik:RadTransitionControl.ContentTemplate>
</telerik:RadTransitionControl>
</Grid>
什麼是綁定錯誤?你應該在輸出窗口中看到它們。 – 2012-02-03 17:31:45
什麼都沒有。屏幕只保留空白而不顯示圖像。 – logeeks 2012-02-03 17:34:02
我的意思是visual studio輸出窗口(查看 - >輸出)。當你遇到綁定相關的問題時,你應該經常在那裏查看。它可能會幫你省去一趟旅程。 ;) – 2012-02-03 17:52:35