private void CheckBox_ControlDeseralizer(SeralizeControlCommonFields p)
        {
            Object O = LogicalTreeHelper.FindLogicalNode(this.DMT_Main_Window_Control, p.ControlName);

            if (!(O is CheckBox CB))
            {
                return;
            }

            CheckBoxControlSaveState pp = new CheckBoxControlSaveState( );

            XmlSerializer x = new XmlSerializer(pp.GetType( ));

            StringReader XmlStringReader = new StringReader(XmlFileContents);

            XmlReaderSettings xmlReaderSettings = new XmlReaderSettings
            {
                IgnoreComments = true,
                IgnoreProcessingInstructions = true,
                IgnoreWhitespace             = true
            };

            XmlReader xmlReader = XmlReader.Create(XmlStringReader, xmlReaderSettings);

            Object o = x.Deserialize(xmlReader);

            pp           = ( CheckBoxControlSaveState )o;
            CB.IsChecked = pp.CheckBoxState;
        }
        private void CheckBoxSerialize(string nameString, UIElement E)
        {
            if (!(E is CheckBox CB))
            {
                return;
            }

            if (nameString == "")
            {
                nameString = CB.Name;
            }

            if (nameString == "")
            {
                String Content = CB.Content as String;
                System.Diagnostics.Debug.WriteLine(String.Format(
                                                       "{0} contents <{1}> {2} ",
                                                       "null name string",
                                                       Content,
                                                       ((System.Environment.StackTrace).Split('\n')) [2].Trim( )));
                return;
            }

            String StateFileName = String.Format("{0}.xml", nameString);

            CheckBoxControlSaveState p = new CheckBoxControlSaveState( );

            p.CommonFields.SaveStateFileName   = StateFileName;
            p.CommonFields.ControlClass        = nameof(CheckBox);
            p.CommonFields.ControlName         = CB.Name;
            p.CommonFields.UpdatedFromXmlFiles = true;

            p.CheckBoxState = CB.IsChecked.Value;
            p.CheckBoxName  = CB.Name;

            XmlSerializer x = new XmlSerializer(p.GetType( ));

            XmlWriterSettings s = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true,
                OmitXmlDeclaration  = true
            };
            XmlWriter w = XmlWriter.Create(StateFileName, s);

            x.Serialize(w, p);
            w.Close( );

            System.Diagnostics.Debug.WriteLine(String.Format("Wrote {0} at {1} ", StateFileName, ((System.Environment.StackTrace).Split('\n')) [2].Trim( )));
        }