Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to call a method whose name is stored in string?(xaml ,vs 2013)

$
0
0

 string methodName = cmbbox.SelectionBoxItem.ToString();
object methodOwner = jsonObject.rates;
object value = typeof(JsonObject).GetMethod(methodName).Invoke(methodOwner, new Type[0];);
Label_value.Text = value.ToString();

error:

Error    3    'System.Type' does not contain a definition for 'GetMethod' and no extension method 'GetMethod' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)  


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>