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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:53:36+00:00 2026-05-24T17:53:36+00:00

I got some kind of weird behavior while trying to use all the power

  • 0

I got some kind of weird behavior while trying to use all the power of MVC… 🙂
I was to trying to bound a simple Path Fill property to some value and cannot succeed.

As a small exemple is worth…
Here’s how to reproduce simply:

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <Path Name="p" Data="M 0,0 h 30 v 30 h -30 v -30" Fill="Beige">
        <Path.Style>
            <Style TargetType="{x:Type Path}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsChecked, ElementName=ch}" Value="True">
                        <Setter Property="Path.Fill" Value="Red"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Path.Style>
    </Path>

    <CheckBox Name="ch" Margin="35,12,-35,-12" />
</Grid>
</Window>

An other issue, It works with this layout but not with a similar one (removing Fill from declaration):

<Path Name="p" Data="M 0,0 h 30 v 30 h -30 v -30">
    <Path.Style>
        <Style TargetType="{x:Type Path}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsChecked, ElementName=ch}" Value="True">
                        <Setter Property="Path.Fill" Value="Red"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsChecked, ElementName=ch}" Value="False">
                        <Setter Property="Path.Fill" Value="Blue"/>
                    </DataTrigger>

                </Style.Triggers>
            </Style>
        </Path.Style>
    </Path>

Could someone enlighten me on the cause ?

  • 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-24T17:53:37+00:00Added an answer on May 24, 2026 at 5:53 pm

    Do not set any Fill on the path itself if you want to change it in a style as that will override your style due to dependency property value precedence.

    Move the initial Fill value into a Setter of the style.

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

Sidebar

Related Questions

I've got some JSON data, but it's all on one line. Does anyone know
i got a kind of weird issue with my HTC desire. I currently test
I'm trying to write some kind of parser in PHP: it receives a text
I got this some kind of permission error in my log. Everything was working
I've got some java script code that implements a kind of slide show. It
I got some problems with finding a bug in php/mysql application, and I wonder
I got some legacy code with that caption spread out as comment almost in
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I've got some Japanese in the ALT attribute, but the tooltip is showing me
I've got some (C#) code that relies on today's date to correctly calculate things

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.