Bind SF Text Input Layout Controls to ViewModel

I have a ContentView on my ContentPages that are contained inside of a  TabbedPage. I am using the Syncfusion Text Input Layout Control. I need to bind properties that are on a viewmodel to the text input layout controls on my ContentViews. In the xaml for these Content views I have declared xml namespaces for the viewmodel and libmodel. Could someone please help me with a soluton for binding my viewmodel properties to the SF Text Input Layout Controls.


1 Reply 1 reply marked as answer

BV Brundha Velusamy Syncfusion Team March 13, 2024 02:09 PM UTC

Hi Ron,


We have drafted a simple sample using the SfTextInputLayout and bound its property values from the view model, as demonstrated in the code snippet below. For your convenience, we have included the sample as an attachment. Kindly review the attached file and inform us if you have any concerns. If your requirements differ from the suggested solution, kindly provide detailed specifications to facilitate a more effective investigation and solution.


Code snippet:

<ContentPage.Content>

 

    <ContentView>

        <Grid RowDefinitions="auto" >

            <core:SfTextInputLayout Hint="{Binding Hint}" HelperText="{Binding HelperText}">

                <Entry Placeholder="{Binding PlaceHolder}"

                       Text="{Binding Text}"/>

            </core:SfTextInputLayout>

        </Grid>

    </ContentView>

</ContentPage.Content>


Regards,

Brundha V


Attachment: TILSample_6768e2ae.zip

Marked as answer
Loader.
Up arrow icon