Forum Discussion

QA-Joseph's avatar
QA-Joseph
Occasional Contributor
15 years ago

Silverlight Properties: Binding

Greetings,



I am attempting to extract a binded value, $1,390.82, from a Silverlight property, and have attached the TC 7.51 Object Properties results and a screen print of the target object. Upon review of the Object Properties screen print you will note that the text "$1,390" is not displayed.



The Silverlight code below displays the "$1,390.92" text on the web page via a binding, "abc.abcPrice".



<StackPanel Orientation="Horizontal" >                    



                <TextBlock x:Name ="txtClaimTotal" Margin="5,0" Text="{Binding abc.abcPrice, Converter={StaticResource NullMessageConverter}}" />                    



</StackPanel>



The "Name" property is available, but do you have an idea as to how I can extract the binded value from "Text"?



Thanks in advance for your assistance.



Best regards,



Joseph

4 Replies

  • QA-Joseph's avatar
    QA-Joseph
    Occasional Contributor
    Greetings,



    Please find attached a screen print of the "Text" property and its value "$1,390", as mentioned in the post thread that was obtained via Silverlight Spy.  I hope this information helps in your review of my question.



    Best regards,



    Joseph
  • QA-Joseph's avatar
    QA-Joseph
    Occasional Contributor
    Hello David,



    The TC 7.51 code below returns the text "txtTotal", not the binded value $1,390.82.



      x = Sys["Process"]("iexplore")["Page"]("http://abc/abc/abc.aspx");



      x1 = x["Form"]("form1")["Panel"]("silverlightControlHost")["UIAObject"]("Silverlight_Control")["UIAObject"]("txtTotal");



      Log["Message"](x1["Name"]);



    In the TC 7.51 Object Property view,  Name  =  UIAObject("txtTotal").



    I am in the middle of a produce release testing cycle and will submit the Silverlight code sample to you promptly.



    Thanks in advance for your support.



    Best regards,



    Joseph



  • Hello Joseph,




    The Name property returns the name of the object. You need to use the NativeUIAObject.Name property. Try using the code below and let me know your results:




    x = Sys["Process"]("iexplore")["Page"]("http://abc/abc/abc.aspx");

    x1 = x["Form"]("form1")["Panel"]("silverlightControlHost")["UIAObject"]("Silverlight_Control")["UIAObject"]("txtTotal");

    Log["Message"](x1["NativeUIAObject"]["Name"]);