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[^]
Create a handler for the slider value changed event. Then in that event handler, set the sound volume of your player. Of course, make sure that whatever values you use in the slider correspond proportionately to the sound volume of your audio player.
I am doing the same thing in my project and here is the code I use:
I cant seem to get a combobox to select a value using Binding. I have a small example that re-creates the issue, I want the combo to have selected Yellow (_colour is set to that on creation) when it first loads. Hope that makes sense
Code is below, just window1 and a class called ViewModel. TIA for any help
The way you have declared SelectedColour isn't right, you don't need a backing field as it that is done automatically. You can either call GetValue/SetValue in the property passing in SelectedColourProperty or implement INotifyPropertyChanged and raise the event in the setter (Then you wouldn't need to inherit from DependencyObject). There may be some other issues as I couldn't test the code atm.
Thanks for your reply, this was a test project and you are right i did not have the Selected Colour correct, i have changed it and it still does not work, so will look at INotifyPropertyChanged, and let you know.
That still does not do what i want, i am starting to think that i am going about this the wrong way
Put simply what i need is a combobox with a datasource of list of my objects (all the same type). Then when the form loads i want the combobox to have preselected an object of my choice (what ever was saved in xml/db)
I am new to wpf and the mvvm pattern, and this is getting a bit frustrating!!
ps for info i changed the colour class to the following as the other throw an exception
I am developing one application using silverlight and .Net.There are some videos to watch.There are some features like rotate,scaling video using silverlight.Now I want to develop feature Throw videos using silverlight like in the following site.
http://www.etsy.com/color.php?ref=fp_nav_colors.If u open that link there are some bubbles,if you click those bubles you will find some images.In that we can throw those images to anywhere. I want to develop that feature using silverlight in my site.Can please anyone help me how to do that task using silverlight and .Net.
Thanks in advance
Last Visit: 31-Dec-99 18:00 Last Update: 28-May-22 7:51