我设法在这里迷惑自己,我有一个对象,我已经转换为数组,现在想得到的值:
echo var_dump((array)$obj['country_id']);
输出:
array(1) { [0]=> string(2) "GB" }
我如何简单地获得“GB”?
答案 0 :(得分:2)
试试这个:
treeViewItem.MouseDoubleClick += (sender, args) => {
TextBlock tb = args.OriginalSource as TextBlock;
if (tb == null) {
return;
}
else if (tb.DataContext is MyClass) {
var myClass = tb.DataContext as MyClass;
//Do something with myClass
}
};