Silverlight XAML databinding to a field
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_FinanceCalculato开发者_C百科rDefaultValuesDomainDataSource" 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!
Try make a readonly property for SelectedModelUcConfigurator and bind to the property.
private int _selectedModelUcConfigurator;
public int SelectedModelUcConfigurator
{
get { return _selectedModelUcConfigurator; }
}
精彩评论