Beispiel #1
0
        /// <summary>
        /// Find control by string and change image to source string
        /// </summary>
        /// <param name="button"></param>
        /// <param name="source"></param>
        private void ChangeButtonImage(string button, string source)
        {
            object item   = ButtonGrid.FindName(button);
            Button knefel = (Button)item;

            knefel.Background = new ImageBrush {
                ImageSource = (ImageSource) new ImageSourceConverter().ConvertFromString(source)
            };
        }
Beispiel #2
0
        public void SetChange(XOObject value)
        {
            var btn = ButtonGrid.FindName(value.Name);

            if (btn is Button)
            {
                if ((btn as Button).Content.Equals(value.Name))
                {
                    (btn as Button).Content    = value.Text;
                    (btn as Button).Tag        = value.Tag;
                    (btn as Button).Background = value.Background;
                }
            }
        }