Saturday, June 29, 2013

Display textbox value and visibility according to selected value of combobox in Metro App

Hello Dewi,


I'm glad to hear that it worked.


Well, you have not posted the code you use to populate the items in the ComboBox, so I did not know about the original structure you used. However, I saw that there had to be a "operatingSystemType" property due to the data binding:



<TextBlock Text="{Binding operatingSystemType}"/>

I also knew the object type due to the string that was saved in your database, "AdminPowershellExample.ServiceReference1.OperatingSystem", which was returned by the following code:



cbOperatingSystem.SelectionBoxItem.ToString();

If SelectionBoxItem had been a String you would have gotten the real string with this line. However, as SelectionBoxItem was an object of the type OperatingSystem, the ToString() function returned the type name, which is the value that was stored in the database.


With this information I knew how I had to cast SelectionBoxItem to be able to access the property operatingSystemType, as I suggested in my last post.


Hope this clears your doubts.




Helge Mahrt - Microsoft Developer Support Escalation Engineer - If my reply answers your question, please mark this post as answered.


No comments:

Post a Comment