views:

36

answers:

1

Hi, in the following code,

<riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:V_FinanceCalculatorDefaultValues, CreateList=true}" Height="0" LoadedData="v_FinanceCalculatorDefaultValuesDomainDataSource_LoadedData" Name="v_FinanceCalculatorDefaultValuesDomainDataSource" QueryName="GetV_FinanceCalculatorDefaultValuesQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:DomainServiceFinanceCalculatorDefaultValues />
            </riaControls:DomainDataSource.DomainContext>
            <riaControls:DomainDataSource.QueryParameters>
                <riaControls:Parameter ParameterName="modelId" Value="{Binding ElementName=modelIdTextBox, Path=Text}" />
            </riaControls:DomainDataSource.QueryParameters>
        </riaControls:DomainDataSource>

how do I set the value of the parameter to a field in the associated C# class?

public int SelectedModelUcConfigurator;

I tried something like this

 <riaControls:Parameter ParameterName="modelId" Value="{Binding ElementName=this, Path=SelectedModelUcConfigurator}" />

I realize this is something simple, but I'm new to WPF ... :-)

Thanks!

+1  A: 

Try make a readonly property for SelectedModelUcConfigurator and bind to the property.

private int _selectedModelUcConfigurator; 

public int SelectedModelUcConfigurator
{ 
get { return _selectedModelUcConfigurator; } 
} 
Einarsson
any chance you could elaborate a little? Thanks!
bmanu
Updated answer.It might not make a difference, I dont know if WPF can bind towards a variable. But even if it doesn't help it's best practise to bind towards a property instead. :)
Einarsson