0

In my application, I need to bind string and bitmapsource properties. the string binding works fine, but bitmapsource is not. It is sure that there are already image data by bitmapsource, as I can save it on disk. I also created a small project and both work fine.

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; }

    ....

can anybody give me the reason?

Many thanks!

1 Answer 1

0

These might be the answers:

1
  • anatoliiG, thanks for the links you provided, but they are still not very helpful. My problem is: <Image x:Key="Txt" Source="{Binding Source={StaticResource MyStringData}, Path=bms}" /> <!--bms is a BitmapSource, it's not fine in my application, BUT it's working in my simple test project! --> Feb 5, 2012 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.