/// <summary>
        /// Reads the buffer to give the input to the proper object
        /// </summary>
        /// <param name="buffer">DVBuffer where the properties are read</param>
        /// <param name="page">Page containing the object getting the input</param>
        internal void ReadInput(DVBuffer buffer, XHtmlPage page)
        {
            IXHtmlEditableObject obj;

            uint id;	// variable de stockage temporaire des identifiants d'objets

            //page.UpdateLayout();

            ProprietesWpf property;
            buffer.Get(out property);
            switch (property)
            {
                #region Bouton
                case ProprietesWpf.BOUTON_DEBUT:						// Bouton (Xwin :  objet bouton)!!!!!!!!!!!!!!!!!!!!!!!!!
                    buffer.Get(out id);
                    var button = (XHtmlButton)page.GetObject(id);

                    if (button == null)
                    {
                        button = new XHtmlButton(page) { Id = id };
                        page.Children.Add(button);
                        page.ListOfObjects.Add(button);
                    }

                    button.ReadProperties(buffer);
                    page.Window.ActiveControl = button;
            //					button.IsEnabled = true;	// impératif pour être sûr que le bouton aura bien le focus (pas évident à cause de la gestion des boutons valides non faite côté serveur)
            //					button.Focusable = true;	// garde-fou. Le Focusable est repassé à false lors du lostFocus() (pour éviter qu'un bouton ne prenne le focus sans qu'on ne l'y autorise)
            //					button.Focus();
                    button.AjouterEnvoisUnObjet(this.Html.Envois, page, StackOfWindows.Count());
                    Html.Envois.Ajouter("xmeInput", page.Id.ToString(), HtmlGlobal.CalculerId(button.Id, page.Id, StackOfWindows.Count()));

                    obj = button;
                    break;
                #endregion Bouton

                #region Case à cocher
                case ProprietesWpf.CASE_A_COCHER_DEBUT:			// CheckBox (Xwin : objet case à cocher)
                    buffer.Get(out id);
                    var checkBox = (XHtmlCheckBox)page.GetObject(id);

                    if (checkBox == null)
                    {
                        checkBox = new XHtmlCheckBox(page) { Id = id };
                        page.Children.Add(checkBox);
                        page.ListOfObjects.Add(checkBox);
                    }

                    checkBox.ReadProperties(buffer);
                    page.Window.ActiveControl = checkBox;
                    checkBox.AjouterEnvoisUnObjet(this.Html.Envois, page, StackOfWindows.Count());
                    Html.Envois.Ajouter("xmeInput", page.Id.ToString(), HtmlGlobal.CalculerId(checkBox.Id, page.Id, StackOfWindows.Count()));
            //					checkBox.Focus();
                    obj = checkBox;
                    break;
                #endregion Case à cocher

                #region Champ
                case ProprietesWpf.CHAMP_DEBUT:						// TextBox (Xwin : objet champ)
                    buffer.Get(out id);
                    var textBox = (XHtmlTextBox)page.GetObject(id);

                    if (textBox == null)
                    {
                        textBox = new XHtmlTextBox(page) { Id = id };
                        page.Children.Add(textBox);
                        page.ListOfObjects.Add(textBox);
                    }
                    textBox.ReadProperties(buffer);
                    page.Window.ActiveControl = textBox;
                    textBox.AjouterEnvoisUnObjet(this.Html.Envois, page, StackOfWindows.Count());
                    Html.Envois.Ajouter("xmeInput", page.Id.ToString(), HtmlGlobal.CalculerId(textBox.Id, page.Id, StackOfWindows.Count()));
            //					textBox.EnFocus();
                    obj = textBox;
                    break;
                #endregion Champ

                #region MultiChoix
                case ProprietesWpf.MULTICHOIX_DEBUT:				// ComboBox (Xwin : objet multichoix)
                    buffer.Get(out id);
                    var comboBox = (XHtmlComboBox)page.GetObject(id);
                    if (comboBox == null)
                    {
                        comboBox = new XHtmlComboBox(page) { Id = id };
                        page.Children.Add(comboBox);
                        page.ListOfObjects.Add(comboBox);
                    }

                    comboBox.ReadProperties(buffer);
                    page.Window.ActiveControl = comboBox;
                    comboBox.AjouterEnvoisUnObjet(this.Html.Envois, page, StackOfWindows.Count());
                    Html.Envois.Ajouter("xmeInput", page.Id.ToString(), HtmlGlobal.CalculerId(comboBox.Id, page.Id, StackOfWindows.Count()));
            //					comboBox.Focus();
                    obj = comboBox;
                    break;
                #endregion MultiChoix

                //#region Champ Caché	!!!!!!!!!!!!!!!!!!!!!!
                //case ProprietesWpf.CHAMP_CACHE_DEBUT:				// PasswordBox (Xwin : objet champ caché)
                //   buffer.Get(out id);
                //   var passwordBox = (XHtmlPasswordBox)page.GetObject(id);
                //   passwordBox.ReadProperties(buffer);
                //   page.Window.ActiveControl = passwordBox.PasswordBox;
                //   passwordBox.Focus();
                //   obj = passwordBox;
                //   break;
                //#endregion Champ Caché

                //#region Champ Date
                //case ProprietesWpf.CHAMP_DATE_DEBUT:						// TextBox (Xwin : objet champ)
                //   buffer.Get(out id);
                //   var datePicker = (XHtmlDatePicker)page.GetObject(id);
                //   datePicker.ReadProperties(buffer);
                //   page.Window.ActiveControl = datePicker;
                //   datePicker.Focus();
                //   obj = datePicker;
                //   break;
                //#endregion Champ Date

                //#region MultiChoix
                //case ProprietesWpf.MULTICHOIX_DEBUT:				// ComboBox (Xwin : objet multichoix)
                //   buffer.Get(out id);
                //   var comboBox = (XHtmlComboBox)page.GetObject(id);
                //   comboBox.ReadProperties(buffer);
                //   page.Window.ActiveControl = comboBox;
                //   comboBox.Focus();
                //   obj = comboBox;
                //   break;
                //#endregion MultiChoix

                //#region Liste
                //case ProprietesWpf.LISTECHOIX_DEBUT:				// ListBox (Xwin : objet multichoix ouvert)
                //   buffer.Get(out id);
                //   var listBox = (XHtmlListBox)page.GetObject(id);
                //   listBox.ReadProperties(buffer);
                //   page.Window.ActiveControl = listBox;
                //   listBox.Focus();
                //   obj = listBox;
                //   break;
                //#endregion Liste

                //#region Groupe Radio
                //case ProprietesWpf.GROUPE_RADIO_DEBUT:				// Radiobutton (Xwin : objet groupe radio)
                //   buffer.Get(out id);
                //   var radioGroup = (XHtmlRadioGroup)page.GetObject(id);
                //   radioGroup.ReadProperties(buffer);
                //   page.Window.ActiveControl = radioGroup;
                //   radioGroup.Focus();
                //   obj = radioGroup;
                //   break;
                //#endregion Groupe Radio

                //#region RichText
                //case ProprietesWpf.RICHTEXT_DEBUT:					// RichTextBox (Xwin : objet texte riche)
                //   buffer.Get(out id);
                //   var richText = (XHtmlRichTextBox)page.GetObject(id);
                //   richText.ReadProperties(buffer);
                //   richText.Input();
                //   page.Window.ActiveControl = richText;
                //   richText.Focus();
                //   obj = richText;
                //   break;
                //#endregion RichText

                default:
                    throw new XHtmlException(XHtmlErrorCodes.UnknownProperty, XHtmlErrorLocations.Application, property.ToString());
            }

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  a faire !!!!!!!!!!!!!!!!!
            //StackOfWindows.Peek().UpdateLayout();			// force un recalcul des hauteurs/largeur pour être sûr que les valeurs dans le SetActiveGroup sont à jour
            //XHtmlTreeColumn.ResetCircles(StackOfWindows.Peek());
            //XHtmlGroupBox.SetActiveGroup((Control)obj);
            //ManageValidButtons(obj);
            //ManageValidMenuItems(obj);
            //ManageValidToolBarItems(obj);
            //ManageValidDataGrids(page.Id);
        }
        /// <summary>
        /// Reads the buffer for a page ID and a XwpfDataGrid Id and returns the corresponding XwpfDataGrid instance
        /// </summary>
        /// <param name="buffer">DVBuffer where the page and XwpfDataGrid IDs are read</param>
        /// <returns>instance of XwpfDataGrid matching the given page and XwpfDataGrid IDs</returns>
        private XHtmlDataGrid GetDataGrid(DVBuffer buffer, out XHtmlPage page)
        {
            XHtmlDataGrid retour,dataGrid;
            string idPage;
            uint idDataGrid;
            buffer.GetString(out idPage);			// Identifiant de la page (string)
            buffer.Get(out idDataGrid);			// Identifiant du tableau (uint)

            page = StackOfWindows.Peek().GetPage(idPage);

            retour = page.GetObject(idDataGrid) as XHtmlDataGrid;
            if (retour != null)
                return retour;

            // BH, si on ne le trouve pas, on le créée
            page = StackOfWindows.Peek().GetPage(idPage);

            dataGrid = new XHtmlDataGrid(page) { Id = idDataGrid };        // est ce que c'est le bon id ?
            page.Children.Add(dataGrid);
            page.ListOfObjects.Add(dataGrid);
            return dataGrid;
        }