WPF - Getting target for hyperlink?
-
How do I get the target for a WPF hyperlink in XAML? I have a listbox that contains hyperlinks. The listbox is bound to a ViewModel.MyHyperlinks collection. ViewModel also has several ICommands exposed as properties. When I click on a hyperlink, it should invoke one of these ICommands. I want to specify which ICommand in a property of the MyHyperlink class. I tried creating a resource to hold the name of the ICommand, but that isn't working. So, my question is: How do I specify an I Command to run in a hyperlink I am loading from an object or a data record? I have created a simple demo project that shows the problem I am having. It can be downloaded here[^] Thanks for your help!
David Veeneman www.veeneman.com
-
How do I get the target for a WPF hyperlink in XAML? I have a listbox that contains hyperlinks. The listbox is bound to a ViewModel.MyHyperlinks collection. ViewModel also has several ICommands exposed as properties. When I click on a hyperlink, it should invoke one of these ICommands. I want to specify which ICommand in a property of the MyHyperlink class. I tried creating a resource to hold the name of the ICommand, but that isn't working. So, my question is: How do I specify an I Command to run in a hyperlink I am loading from an object or a data record? I have created a simple demo project that shows the problem I am having. It can be downloaded here[^] Thanks for your help!
David Veeneman www.veeneman.com
I found my answer and wrote it up as a Code Project article. Hopefully, it will help other people down the road.
David Veeneman www.veeneman.com