Question: I know how to pass a vector to a function, but how do I pass a vector index to a function, or at least specify which index the function is modifying. For example, I'm working on a Car class and it has a vector if wheel pointers and in order to remove one of the wheels my function looks like this:

```
Wheel& remove() {
    for (int i = 0; i < wheels.size(); i++) {
        if (wheels[i].position == wheels.at(i)) {
            ??
        }

```

what do I need to pass to the function in order to specify which wheel I want removed? When a wheel is removed, the position where it was is still there and can be filled by another wheel. Let's say for example the car had 4 wheels...if I wanted to remove the 2nd index in the wheel vector, what does the function argument for remove() need to take in order to do it? Should I pass in the vector and then the specific index....and if so, what does the syntax look like?

Answer: 
You can achive this like this:

```
<Label Height="25" Margin="26,27,116,0" Name="label1" VerticalAlignment="Top">
    <Hyperlink Click="Hyperlink_Click">Click Me</Hyperlink>
</Label>

```

and handle it like this:

```
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
    Window2 form2 = new Window2();
    form2.Show();
}

```
You could just handle the click event:

```
<Hyperlink Click="Hyperlink_Click">Link</Hyperlink>

```

```
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
    Dialogue diag = new Dialogue();
    diag.Show();
}

```

---

You could also go crazy with XAML:

```
<Hyperlink>
    <Hyperlink.Style>
        <Style TargetType="{x:Type Hyperlink}">
            <Style.Triggers>
                <EventTrigger RoutedEvent="Hyperlink.Click">
                    <BeginStoryboard>
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
                                <Storyboard.Target>
                                    <local:Dialogue />
                                </Storyboard.Target>
                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>
    </Hyperlink.Style>
    <Hyperlink.Inlines>
        <Run Text="Open Dialogue"/>
    </Hyperlink.Inlines>
</Hyperlink>

```

This however is very problematic since once the dialogue is closed it cannot be reopened, that means when you click the hypelink again an exception will be thrown.

---

Using interactivity you could do this without such problems (needs a reference to the Blend SDK though):

```
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

```

```
<Hyperlink>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
            <t:CreateDialogAction Type="{x:Type local:Dialogue}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <Hyperlink.Inlines>
        <Run Text="Open Dialogue"/>
    </Hyperlink.Inlines>
</Hyperlink>

```

The action for this:

```
public class CreateDialogAction : TriggerAction<Hyperlink>
{
    public Type Type { get; set; }

    protected override void Invoke(object parameter)
    {
        if (Type != null && Type.IsSubclassOf(typeof(Window)) && Type.GetConstructor(Type.EmptyTypes) != null)
        {
            Window window = Type.GetConstructor(Type.EmptyTypes).Invoke(null) as Window;
            window.Show();
        }
    }
}

```