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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:36:40+00:00 2026-06-04T12:36:40+00:00

I have two simple margin styles defined, one based off the other. <Style x:Key=marginStyle

  • 0

I have two simple margin styles defined, one based off the other.

<Style x:Key="marginStyle" TargetType="FrameworkElement">
    <Setter Property="Margin" Value="0,10,20,10"/>
</Style>

<!-- based on marginStyle -->
<Style x:Key="marginIndentStyle" TargetType="FrameworkElement" BasedOn="{StaticResource marginStyle}">
    <Setter Property="Margin" Value="10,0,0,0"/>
</Style>

In the derived ‘marginIndentStyle’ style, I want adjust the margin’s Left prop to be 10 more than the Left prop in the base ‘marginStyle’ style, that is 10 more than what it is currently set at. Using a like above overrides the values completely. I just want to add to it such that the resultant margin for the derived ‘marginIndentStyle’ style is “10,10,20,10”.

Note, I dont want to strictly set its value to 10,10,20,10 b/c I want any changes in the ‘marginStyle’ style to be reflected in the derived ‘marginIndentStyle’ style.

Is this possible?

  • 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-06-04T12:36:42+00:00Added an answer on June 4, 2026 at 12:36 pm

    AFAIK, this is not possible without a sizable amount of code.

    An easier way will be to have two styles with static margins that are applied to two different panels\decorators.

    Something like:

    <Border Style="{StaticResource marginIndentStyle}">
        <Border Style="{StaticResource marginStyle}">
             .....
        </Border>
    </Border>
    

    This, effectively, will compound the margins. So what ever is in the second border will have the margin as combination of the first and the second margins.

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

Sidebar

Related Questions

Let's say I have two simple models project t.string :title vote t.references :project t.integer
I have two very simple, identical UITableViews in my app that are populated with
I have these two simple files that define a C++ class with a tryME
I have two geo-spatial simple convex polygon areas, in latitudes and longitudes (decimal degrees)
Question is simple: I have two List List<String> columnsOld = DBUtils.GetColumns(db, TableName); List<String> columnsNew
I have a grid view that has two simple columns, a report number and
Let's say I have two strings like this: XABY XBAY A simple regex that
I have the following code that fills dataTable1 and dataTable2 with two simple SQL
I am trying to design a simple application where in I have two entities
The situation is very simple, I have two panel. In the event of OnMouseOver

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.