0
在我的應用程序,我需要綁定的字符串和的BitmapSource性能。字符串綁定工作正常,但bitmapsource不是。通過bitmapsource可以確定已經有圖像數據,因爲我可以將它保存在磁盤上。我也創建了一個小項目,兩者都很好。xaml中的字符串綁定很好,但爲什麼BitmapSource綁定不是?
XAML:
...
<ObjectDataProvider x:Key="MyStringData"
ObjectType="{x:Type local:ImageProcess}" />
<Image x:Key="Txt" Source="{Binding Source={StaticResource MyStringData}, Path=uri}" /> <!--uri is a string, it's fine -->
<Image x:Key="Txt" Source="{Binding Source={StaticResource MyStringData}, Path=bms}" /> <!--bms is a BitmapSource, it's not fine -->
...
C# ....
public string urii { set; get; }
public BitmapSource bms { set; get; }
....
有誰能夠給我的理由嗎?
非常感謝!
anatoliiG,感謝你提供的鏈接,但他們仍然不是非常有幫助。我的問題是:<圖像X:鍵= 「TXT」 來源= 「{綁定源= {StaticResource的MyStringData},路徑= BMS}」/><! - BMS是一個的BitmapSource,它在我的應用程序不細,但它的!在我簡單的測試項目中工作! - > – user1189507 2012-02-05 01:07:18