tags:

views:

37

answers:

1

Is there a way to declare a tuple in xaml so I can use it as a converterparameter?

A: 

You don't need to declare it in XAML. You can use x:Static to assign a ConverterParameter declared in code:

<TextBlock Text="{Binding Converter={x:Static local:MyConverter.Default}, ConverterParameter={x:Static local:MySettings.Name}}" />

And what you're accessing just needs to be static:

public static class MySettings
{
    public static string Name
    {
        get { return "Test"; }
    }
}
John Bowen
I am aware I dont need to in fact I have this already Tuple<Visibility, Visibility> visibleTuple = new Tuple<Visibility, Visibility>(Visibility.Collapsed, Visibility.Visible); this.Resources.Add("visibleTuple", visibleTuple);just thought there had to be a way to do it in xaml with all the new features in xaml2009
Wegged