コード例 #1
0
        private void ApplyingTemplate()
        {
            _hostContainer = GetTemplateChild(ButtonBaseConstants.ContentHostName) as Grid;
            _contentBody   = GetTemplateChild(ButtonBaseConstants.ContentBodyName) as FrameworkElement;

            ButtonBaseHelper.UpdateImageSource(_contentBody, _hostContainer, ImageSource, Stretch);
        }
        private void UpdateImageSource()
        {
            var hostContainer         = GetTemplateChild(ButtonBaseConstants.ContentHostName) as Grid;
            var hostContainerDisabled = GetTemplateChild(ButtonBaseConstants.DisabledContentHostName) as Grid;

            var contentEnabled  = GetTemplateChild(ButtonBaseConstants.EnabledContentControlName) as FrameworkElement;
            var contentDisabled = GetTemplateChild(ButtonBaseConstants.DisabledContentControlName) as FrameworkElement;

            ButtonBaseHelper.UpdateImageSource(contentEnabled, hostContainer, ImageSource, Stretch);
            ButtonBaseHelper.UpdateImageSource(contentDisabled, hostContainerDisabled, ImageSource, Stretch);
        }
コード例 #3
0
 private void UpdateImageSource()
 {
     ButtonBaseHelper.UpdateImageSource(_contentBody, _hostContainer, ImageSource, Stretch);
 }