question

PaoloMossa-0994 avatar image
0 Votes"
PaoloMossa-0994 asked RobCaplan answered

Share the content of Edit in different cards of TabView

Hi to All. I have two Edit controls in an Xaml file that must share the same text.

Below the partials codes of the TabView:

<xct:TabView>
<xct:TabViewItem Text="Grafici" BackgroundColor="AntiqueWhite" HeightRequest="35" TextColorSelected="LimeGreen">
<xct:TabViewItem.Content>
<StackLayout Margin="0,0,0,0">
<Editor x:Name="editable" IsVisible="False" BackgroundColor="Aquamarine" HeightRequest="100" Keyboard="Plain" />


 <xct:TabViewItem  Text="Testo" BackgroundColor="BlanchedAlmond" HeightRequest="35" TextColorSelected="LimeGreen">
         <xct:TabViewItem.Content>
             <StackLayout>
                 <Editor x:Name="testogood" IsVisible="True" BackgroundColor="Aquamarine" HeightRequest="900" Keyboard="Plain"/>


How can I do it?
Thanks in advanced for any reply

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RobCaplan avatar image
0 Votes"
RobCaplan answered

Hi Paulo,

I redirected your three threads to the same one as they are all basically the same question with the same answer.

To connect the data displayed in two controls one can "Data Bind" the controls together. This can be done directly (Control X binds to Control Y), but more commonly we separate out the data from the presentation: create a backing class with the data we want the controls to show and then bind both controls to that data.

To get started on Data Binding see the documentation starting at Xamarin.Forms / App Fundamentals / Data Binding

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.