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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:07:33+00:00 2026-06-18T17:07:33+00:00

I’m working on a VS 2012 Express WPF project (C# code-behind) and I’m getting

  • 0

I’m working on a VS 2012 Express WPF project (C# code-behind) and I’m getting the error “A loop was detected in the property expressions”. Now before I continue, I know why I’m getting it – I’m just not sure what to do about it or if it even needs to be handled because even though it shows up in the error list and is underlined in blue, the program compiles and runs just fine. I’ve Googled this of course and results have varied. My question is a two-parter but first, here’s the rundown:

The offending code:

<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<!-- setter properties -->
</Style>

As you can see, it’s a style for Button that refers to Button which is what causes the issue. The first workaround I read involved separating the code like so:

<Style x:Key="ButtonStyleToApply" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
    <!-- setter properties -->
</Style>
<!-- and in another style dictionary, -->
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonStyleToApply}"/>

…and then the two style sets go into different dictionaries. Obviously, this didn’t do any good either – VS still sniffed out what I was doing but it still compiles and runs fine. Now here is yet another workaround:

“There were some architectural changes in the XAML Designer in Visual Studio which has regressed this scenario. We will work to improve this experience in future but right now you can work-around this issue by not defining the resources in the Application object (App.xaml) but instead defining them in the local document (MainPage.xaml)”

This was posted in a tech support query Here. (Connect.Microsoft.Com)

But I trust hands on experience from the every-man. What can my fellow coders tell me? My question is a two-parter. 1. Do I even need to bother with the workaround if the program is compiling? And 2. If I’m good to go, is there a way to tell VS to just ignore it? I know ignoring it on my part or VS’s is probably considered “bad practice” but beyond that…?

  • 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-18T17:07:34+00:00Added an answer on June 18, 2026 at 5:07 pm

    There is nothing wrong with the syntax you are using; it’s legal to define an implicit style that is based on an existing implicit style. The code sample you provided works for me in VS 2010 with no complaints, but produces the error in question in VS2012.

    Since it also compiles and runs fine in both versions, I suspect the problem is with the VS 2012 XAML designer support. How big of a deal this is for you depends on how much you rely on designer rendering for your WPF views. (For example, I usually hide the rendered view and work exclusively in the XAML view.) If you do use that feature, you may notice that not all of your properties are being set properly at design time. Of course, since the setters usually don’t have much effect until run-time anyway, you may never notice the difference.

    And, as your question correctly points out, even Microsoft has identified this as a regression in VS2012, which strongly suggests that they don’t expect the error to happen and will likely fix the designer bug at some point in the future.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to loop through a bunch of documents I have to put
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.