Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6777709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:10:49+00:00 2026-05-26T16:10:49+00:00

I have a problem with a databinding. I have a class with properties to

  • 0

I have a problem with a databinding. I have a class with properties to customize a style written with wpf. All properties works fine, except for the drop shadow color property from ContentPresenter. that is the only property that didn’t work. I’ve tried a lot of things but no case. The property is called FontShadow ( type Color )

class code:

public class ButtonStyle
{
    public String Name { get; set; }
    public String Fill { get; set; }
    public String FontColor { get; set; }
    public Color FontShadow { get; set; }
    public String Image { get; set; }
    public int ImageWith { get; set; }
    public int ImageHeight { get; set; }
    public int FontSize { get; set; }
    public String FontName { get; set; }
    public Boolean Bold { get; set; }
    public String HAligment { get; set; }
    public String ButtonStyleName { get; set; }
}

the xaml code:

<Style x:Key="CommonActionButton" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        .....
                        <ContentPresenter DataContext="{TemplateBinding DataContext}" x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.RowSpan="2" RenderTransformOrigin="0.5,0.5">
                            <ContentPresenter.Effect>
                                <DropShadowEffect BlurRadius="3" ShadowDepth="2" Color="{Binding FontShadow, FallbackValue=Black}"/>
                            </ContentPresenter.Effect>
                            <ContentPresenter.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                        .....
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

one a create a button i assign the style and the de data context (instance of ButtonStyle). Every property except FontShadow works.

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:10:49+00:00Added an answer on May 26, 2026 at 4:10 pm

    Have a look at this question: WPF Image 'highlight' with DropShadowEffect can't bind color

    You should set the DataContext for this kind of databinding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into a problem w/ my model for databinding in WPF. I
I've been having trouble with some databinding with WPF. I have a class to
I have problem with databinding in the Win.Forms DataGridView control. Example: public class A
I have problem with return statment >.< I want to store all magazine names
i have problem with autorotate on iphone i set up in all classes -
Greetings folks! I'm running into a problem with WPF databinding that I hope you
I have a helper class that implements ITypedList, to provide objects for databinding against
In WPF app I have an Observable Collection which is connected through databinding with
I have a DataGridView that uses databinding, with manually created columns, and this works
I have what I think to be an odd problem with listview databinding. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.