Click here to Skip to main content
15,066,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As described in MVVM Friendly DataTemplate switching[^] I wanted to Switch my Usercontrols depending on an integer variable.

Sadly, the screen stays white, and I cannot figure out why

What I have tried:

        <ControlTemplate x:Key="DeciderControl">

                    <Control x:Name="decider" Template="{StaticResource DeciderControl}"/>
                        <DataTrigger Binding="{Binding IntTest}" Value="1">
                            <Setter TargetName="decider" Property="Template" Value="{StaticResource DeciderControl}"/>

IntTest is always 1, set in the Constructor of my ViewModel.
the userControl also works - if I just show it in the ListBox it's ok.
Updated 17-Mar-16 13:25pm

1 solution

Ask the author of this article, Pete O'Hanlon, by joining the discussion at the "Comments and Discussions" section on the article page: MVVM Friendly DataTemplate switching[^].

Click "Add a Comment or Question" to ask your question. Peter will get a notification and a change to answer you. From what I know, he is quite a responsive person.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900