A loop was detected in property expressions

I am working on a VS 2012 Express WPF project (C # code-behind), and I get the error message "The loop was detected in property expressions." Now, before continuing, I know why I get it - I'm just not sure what to do with it, or even if it needs to be handled, because although it appears in the error list and is underlined in blue, the program compiles and works just fine . Of course, I did it in Googled, and the results changed. My question is bipartisan, but first, here's the summary:

Violation Code:

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

As you can see, this is a Button style that refers to Button, which causes the problem. The first workaround I read included code splitting as follows:

<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}"/>

... . , - VS , , . :

" XAML Designer Visual Studio , . , , Application (App.xaml), (MainPage.xaml)"

. (Connect.Microsoft.Com)

. -? - . 1. , ? 2. , , ? , , VS, , " ", ...?

+5
1

, ; , . , , VS 2010 - , VS2012.

, , VS 2012 XAML. , , WPF. (, XAML.) , , . , , , .

, , Microsoft VS2012, , , , - .

+12

All Articles