0

I have a tabcontrol, each item of this tabcontrol is made with some label. I insert manually all the information in the different label but I want to bind the information I think is more clean. I have an entity BE this is the data that I want to bien this is my code:

                    numBe.Content = BE.BE_Numero_BE;
                    BeDate.Content = BE.BE_Date;
                    Numcarnet.Content = BE.BE_Numero_carnet;
                    BeFourn.Content = BE.BE_Fournisseur;
                    BECom.Content = BE.BE_Commercial;
                    NumTicket.Content = BE.BE_Numero_ticket;
                    NumCnt.Content = BE.BE_Numero_carnet;
                    TypeBe.Content = BE.BE_Type_BE;
                    BeImm.Content = BE.BE_Immatriculation;
                    BeSC.Content = BE.BE_Stock_client;
                    NumS.Content = BE.BE_N_serie;
                    BeSa.Content = BE.BE_SA;
                    BeEx.Content = BE.BE_Exutoire;
                    BeNrcde.Content = BE.BE_NrCde;

I already do this but I don't know how to bind :

<TabControl x:Name="TabControlBe" HorizontalAlignment="Left" Margin="17,425,0,0" Grid.Row="1" Width="471" >
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock>BE1</TextBlock>
                    </StackPanel>
                </TabItem.Header>
                <Grid>
                    <Label Content="Numero Be:" Height="27" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75"/>
                    <Label x:Name="numBe" Content="{Binding BE_Numero}" Height="25" Margin="0,0,50,0" HorizontalAlignment="Right" Width="331" VerticalAlignment="Top"  />...

Thanks for your help

Litisqe Kumar
  • 2,512
  • 4
  • 26
  • 40
  • It is *not* our job to teach you a programming language. Please find out about data binding from the [Data Binding Overview](https://msdn.microsoft.com/en-us/library/vstudio/ms752347(v=vs.100).aspx) page on MSDN. – Sheridan Jul 02 '15 at 12:17
  • i know how to use the data binding but not for the tabcontrol –  Jul 02 '15 at 12:22
  • [WPF TabControl Databinding](http://stackoverflow.com/questions/686074/wpf-tabcontrol-databinding) – Sheridan Jul 02 '15 at 13:00
  • 1
    Start with `` You will have to set the DataContext of the UserControl or the Window to a Class that has the BE class as a property with name "BE". – Dabblernl Jul 02 '15 at 13:45

0 Answers0