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 310385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:49:43+00:00 2026-05-12T07:49:43+00:00

I’m struggling a little bit with some XAML syntax I hope someone can advise

  • 0

I’m struggling a little bit with some XAML syntax I hope someone can advise on. I want to create an “Effect” type style resource which contains a DropShadowEffect definition which can be reused rather than always manually setting the properties. Here’s what I have:

<Style TargetType="DropShadowEffect" x:Name="DropShadowEffectStyle">
  <Setter Property="BlurRadius" Value="5" />
  <Setter Property="Direction" Value="315" />
  <Setter Property="ShadowDepth" Value="2" />
  <Setter Property="Opacity" Value="0.5" />
</Style>

<Style TargetType="TextBlock" x:Name="PageTabLabelStyle">
  <Setter Property="FontSize" Value="16" />
  <Setter Property="FontFamily" Value="Arial" />
  <Setter Property="Foreground" Value="#EFEFEF" />
  <Setter Property="VerticalAlignment" Value="Center" />
  <Setter Property="Margin" Value="0, 10, 0, 10" />
  <Setter Property="Effect" Value="{StaticResource DropShadowEffectStyle}" />
</Style>

This fails dismally each time it runs so I’m obviously missing something. I think it’s around the “Effect” property of the text block style expecting an “Effect” type rather than a “DopShadowEffect” type. Any ideas?

  • 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-12T07:49:43+00:00Added an answer on May 12, 2026 at 7:49 am

    You cannot “style” an effect, because Style is a property of Control and an effect is not a Control.

    What you really want to do is put the effect itself into the resource dictionary and use a StaticResource reference to point to it. Something like:

    <UserControl.Resources>
        <DropShadowEffect x:Key="dropShadow" BlurRadius="25" Direction="315" />
        <Style TargetType="TextBlock" x:Name="PageTabLabelStyle">
            <Setter Property="FontSize" Value="16" />
            <Setter Property="FontFamily" Value="Arial" />
            <Setter Property="Foreground" Value="#EFEFEF" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0, 10, 0, 10" />
            <Setter Property="Effect" Value="{StaticResource dropShadow}" />
        </Style>
    </UserControl.Resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying (or rather struggling) to create a little Blackjack game. After some JavaScript
I'm helping someone fix a VB application but struggling with a little bit of
Hoping someone can help me out here, been struggling with this for a little
I'm struggling to create a little Blackjack console game in C++. I've written almost
I am struggeling a little bit with some options for linking on a project
I'm a C# beginner and am struggling a little bit with how classes relate
I am struggling a little bit with the concept of deferred binding and/or dependency
I'm struggling a bit on the best way to do this with as little
I am struggling a little bit while trying to display a custom 404 error
I'm new to python and after struggling with myself a little bit I almost

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.