I m working on a WP7 app where I use a pre-populated SQLCE database. Therefore I use a lot of databound controls. Right now I m a bit in trouble. To keep it short: I need to access the last ListBoxItem (not the business object) of a databound ListBox and change some Properties like the Margin of that last Item. I was not able to get this Item by using the methods of the VisualTreeHelper class nor by using something like
(myListBox.Items.Last() as ListBoxItem).Margin = new Thickness(0, 0, 0, 0);
我 ListBox. 项目似乎无效(!)
There is some black magic going on, so is there a simple way? Thank you in advance!