{"action":"created","issue":{"url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/10","labels_url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/10/comments","events_url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/10/events","html_url":"https://github.com/EmptyKeys/UI_Generator/issues/10","id":114484549,"number":10,"title":"Binding ElementName not working","user":{"login":"ellisonch","id":1285287,"avatar_url":"https://avatars.githubusercontent.com/u/1285287?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonch","html_url":"https://github.com/ellisonch","followers_url":"https://api.github.com/users/ellisonch/followers","following_url":"https://api.github.com/users/ellisonch/following{/other_user}","gists_url":"https://api.github.com/users/ellisonch/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonch/subscriptions","organizations_url":"https://api.github.com/users/ellisonch/orgs","repos_url":"https://api.github.com/users/ellisonch/repos","events_url":"https://api.github.com/users/ellisonch/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-01T18:28:41Z","updated_at":"2015-11-01T18:42:30Z","closed_at":null,"body":"It seems that using `ElementName` in a binding should either generate an error, or it should generate different code.  Currently, it seems to be ignored.\r\n\r\n```\r\n<ToggleButton x:Name=\"CheatButton\">Cheat</ToggleButton>\r\n<Popup x:Name=\"CheatPopup\" StaysOpen=\"False\" IsOpen=\"{Binding ElementName=CheatButton, Path=IsChecked}\">\r\n    <TextBlock>FooBarBaz</TextBlock>\r\n</Popup>\r\n```\r\n\r\nThe above generates the same code as the following (with `ElementName=CheatButton` removed):\r\n```\r\n<ToggleButton x:Name=\"CheatButton\">Cheat</ToggleButton>\r\n<Popup x:Name=\"CheatPopup\" StaysOpen=\"False\" IsOpen=\"{Binding Path=IsChecked}\">\r\n    <TextBlock>FooBarBaz</TextBlock>\r\n</Popup>\r\n```\r\nThe code that these both generate is:\r\n```\r\nthis.CheatPopup = new Popup();\r\nthis.e_6.Children.Add(this.CheatPopup);\r\nthis.CheatPopup.Name = \"CheatPopup\";\r\nBinding binding_CheatPopup_IsOpen = new Binding(\"IsChecked\");\r\nthis.CheatPopup.SetBinding(Popup.IsOpenProperty, binding_CheatPopup_IsOpen);\r\n```\r\nwhich doesn't seem to be using the `ElementName` property.\r\nAt runtime, this generates the following error (I assume because `IsChecked` is a property of the `CheatButton`, not of the current `DataContext`)\r\n```\r\nAn unhandled exception of type 'System.ArgumentException' occurred in EmptyKeys.UserInterface.dll\r\n\r\nAdditional information: Binding error: Property Path - Property not found\r\n```\r\nFWIW, it also would be useful to include the property path being looked for in the error, if possible.  E.g., `Additional information: Binding error: Property Path=\"IsChecked\" - Property not found`"},"comment":{"url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/comments/152851256","html_url":"https://github.com/EmptyKeys/UI_Generator/issues/10#issuecomment-152851256","issue_url":"https://api.github.com/repos/EmptyKeys/UI_Generator/issues/10","id":152851256,"user":{"login":"EmptyKeys","id":7707327,"avatar_url":"https://avatars.githubusercontent.com/u/7707327?v=3","gravatar_id":"","url":"https://api.github.com/users/EmptyKeys","html_url":"https://github.com/EmptyKeys","followers_url":"https://api.github.com/users/EmptyKeys/followers","following_url":"https://api.github.com/users/EmptyKeys/following{/other_user}","gists_url":"https://api.github.com/users/EmptyKeys/gists{/gist_id}","starred_url":"https://api.github.com/users/EmptyKeys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmptyKeys/subscriptions","organizations_url":"https://api.github.com/users/EmptyKeys/orgs","repos_url":"https://api.github.com/users/EmptyKeys/repos","events_url":"https://api.github.com/users/EmptyKeys/events{/privacy}","received_events_url":"https://api.github.com/users/EmptyKeys/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T18:42:30Z","updated_at":"2015-11-01T18:42:30Z","body":"ElementName is not supported and It's already in backlog - http://emptykeys.com/Community/aft/12"}}