Beispiel #1
0
        public virtual void ApplySkin(XmlNode pXmlNode, string pSkinPath)
        {
            Clear();

            Name = pXmlNode.Name;

            if (SkinningHelper.XmlRectangleEntry(XPATH_BOUNDS, pXmlNode, ref _bounds))
            {
                OnSizeChanged(null, null);
            }
            if (SkinningHelper.XmlValidFilePath(XPATH_BACKGROUND_IMAGE, pXmlNode, pSkinPath, ref _backGroundBitmapPath))
            {
                _backGroundBitmap = null;
            }

            _hasColor = SkinningHelper.XmlColorEntry(XPATH_BACKGROUND_COLOR, pXmlNode, ref _backgroundColor);
            if (_hasColor)
            {
                _backgroundColorBrush = null;
            }


            foreach (XmlNode childNode in pXmlNode.ChildNodes)
            {
                if (childNode.NodeType == XmlNodeType.Element)
                {
                    var viewControl = ViewControlFactory.GetViewControlAndApplySkin(childNode.Name, pSkinPath, childNode);
                    if (viewControl != null)
                    {
                        AddViewControl(viewControl);
                    }
                }

                //if (viewControl is ThermometerProgressBar)
                //{
                //    _progressBar = viewControl as ThermometerProgressBar; ;
                //}
            }
        }
 public void ApplySkin(XmlNode pXmlNode, string pSkinPath)
 {
     SkinningHelper.XmlRectangleEntry(XPATH_BOUNDS, pXmlNode, ref _bounds);
     SkinningHelper.XmlValidFilePath(XPATH_OVERLAY_MASK, pXmlNode, pSkinPath, ref _overlayMaskPath);
     SkinningHelper.XmlValidFilePath(XPATH_BACKGROUND, pXmlNode, pSkinPath, ref _backgroundPath);
 }