{"id":657,"date":"2016-12-01T21:48:25","date_gmt":"2016-12-01T21:48:25","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=198"},"modified":"2023-03-14T14:58:35","modified_gmt":"2023-03-14T14:58:35","slug":"get-name-of-control-calling-a-method","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/methods-uwp-programming-in-c\/get-name-of-control-calling-a-method","title":{"rendered":"Get name of control calling a method"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Get The Name <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tprivate void MyMethod_Click(object sender, RoutedEventArgs e)\n\t{\n\t\tControl CallingControl = (Control)sender;\n\t\tString CallingObjectName = CallingControl.Name;\n\t}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Get The Actual Control <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tprivate void chkOp_Click(object sender, RoutedEventArgs e)\n\t{\n\t\tControl CallingControl = (Control)sender;\n\t\tCheckBox CallingCheckbox = (CheckBox)CallingControl;\n\t\tif ((bool)CallingCheckbox.IsChecked<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\tprivate void chkOp_Click(object sender, RoutedEventArgs e)\n\t{\n\t\tCheckBox CallingCheckbox = (CheckBox)CallingControl;\n\t\tif ((bool)CallingCheckbox.IsChecked<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">For Specific Object Types <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tprivate static Windows.Media.Playback.MediaPlayer BackgroundMediaPlayer1 = new Windows.Media.Playback.MediaPlayer();\n\tprivate static Windows.Media.Playback.MediaPlayer BackgroundMediaPlayer2 = new Windows.Media.Playback.MediaPlayer();\n\n\n\tprivate static void MediaPlayer_MediaEnded(Windows.Media.Playback.MediaPlayer sender, object args)\n\t{\n\t\tif (sender == BackgroundMediaPlayer1)\n\t\t{\n\t\t}\n\n\t\tif (sender == BackgroundMediaPlayer2)\n\t\t{\n\t\t}\n\t}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Get The Name Get The Actual Control For Specific Object Types<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128],"tags":[],"class_list":["post-657","post","type-post","status-publish","format-standard","hentry","category-methods-uwp-programming-in-c"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=657"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/657\/revisions"}],"predecessor-version":[{"id":1277,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/657\/revisions\/1277"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}