Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with WPF in VS 2012 with C# utilizing the MVVM paradigm. So when I found this article
Custom popup and windows in WPF the MVVM way I was very excited and have used it extensively.

I create my applications using the ApplicationView to load up my different view models each of which is a user control. So Each user control has a button on the left and each operates independently.

My problem comes in when using the Custom popup as describe in the article above. The popup works fine when I am in one user control. Then when I click on the button to go to the other user control and do whatever over there and then come back to the previous view the popup no longer works.

I have stepped through the code and done everything I can think of including modifying the custom popup window dll. But with no luck. I am sure many people have used this control because it is really a great control.

Hopefully enough people out there have used this control and design their apps in a similar fashion so as to understand what I am describing.

My application view looks like so

XML
<Window x:Class="PremierCareFinance.ApplicationView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:PremierCareFinance"  
         xmlns:cancelled="clr-namespace:PremierCareFinance.CancelledOrders"
        
         xmlns:wpfx="http://schemas.xceed.com/wpf/xaml/toolkit"       
        Title="Premier Care Finance" Height="800" Width="1280" Icon="finance.ico">

   
    <Window.Resources>
        <DataTemplate DataType="{x:Type local:HomeViewModel}">
            <local:HomeView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type local:CustomerViewModel}">
            <local:CustomerView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type cancelled:CancelledOrderViewModel}">
            <cancelled:CancelledOrderView  />  
        </DataTemplate>
      
    </Window.Resources>
    <Grid>
        <DockPanel>
        <Border DockPanel.Dock="Left" BorderBrush="Black" BorderThickness="0,0,1,0">
            <ItemsControl ItemsSource="{Binding PageViewModels}" >
                <ItemsControl.ItemTemplate>
                    <DataTemplate >

                        <Button Content="{Binding Name}" 
                                Command="{Binding DataContext.ChangePageCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
                                CommandParameter="{Binding }"  Margin="2,5"/>

                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </Border>

        <ContentControl Content="{Binding CurrentPageViewModel}" />
    </DockPanel>
     
   
    </Grid>
</Window>



Then all of my views are UserControls and I utilize tabs quite a bit.

Any help is appreciated
Posted
Comments
Praveen Raghuvanshi 23-May-14 2:45am    
Link for the referred article is missing.
Member 8633753 23-May-14 11:19am    
sorry bout that
http://blog.typps.com/2011/04/custom-popup-and-windows-in-wpf-mvvm.html

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

  Print Answers RSS


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