Share the content of Edit in different cards of TabView

Paolo Mossa 121 Reputation points

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:TabViewItem Text="Grafici" BackgroundColor="AntiqueWhite" HeightRequest="35" TextColorSelected="LimeGreen">
<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">
                <Editor x:Name="testogood" IsVisible="True" BackgroundColor="Aquamarine" HeightRequest="900" Keyboard="Plain"/>

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

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,013 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rob Caplan - MSFT 4,867 Reputation points Microsoft Employee

    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

    0 comments No comments

0 additional answers

Sort by: Most helpful