This project is read-only.

Problems with SCSF may 2007 + solving active view problem

Oct 1, 2007 at 10:10 PM
Edited Oct 1, 2007 at 10:14 PM
Hello i have a recurrent problem in my solution:
I´am developping in VS 2005 with CAB and WPF with SCSF May 2007, i have update my SCSF to have the option to build WPF view.
But i have problems with my WPF views :

After, i build the WPF views with SCSF i change the inheritance of my class MyView.cs from :

System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector

To

ViewWPF, System.Windows.Markup.IComponentConnector

Where the source of the new class ViewWPF is :


public class ViewWPF : System.Windows.Controls.UserControl, IView
    {
        private Guid _guid;
 
        public ViewWPF()
        {
            InitializeComponent();
            _guid = Guid.NewGuid();
        } 

I do that to solv the active view problem see Chris Holmes solution at
http://www.chrisholmesonline.com/2007/05/11/cab-solving-the-active-view-problem/
After
If i perform a rebuild (not a simple build), and i have the message below :

This file has been modified outside the source code editor, do you want to reload it ?
The source code is beeing change is placed in the folder

Mysolution\Myproyect\myviewFolder\Obj\Debug\View\myviewFolder\My_view.g.cs

next to this file:
My_view.baml

If i input Yes, My_view.g.cs appear likebefore i change the inheritance !!
and i have the error message :

Partial declarations of 'My_solution.My_project.MyViewClass' must not specify different base classes

It´s normal because my view class doesn´t have the same base classes than the My_view.g.cs.
I think this is mecanism that VS2005 use to build the binarie file .baml with this file My_view.g.cs, but i don´t know wath to do !

Thanks for your help.
Oct 4, 2007 at 12:35 AM
You don´t have any idea, or a way to solv this issue ?

Thanks
Oct 4, 2007 at 11:07 AM
Hi,

The "g" in "My_view.g.cs" stands for generated. It is generated every time you build. Therefore, any changes you make to it will be lost.

If you need to change the class from which your user control is inheriting, change the XAML from <UserControl ...> to <ViewWPF ...>.

HTH,
Kent
Oct 4, 2007 at 2:17 PM
Thank you very much for your solution, i ´ll try this now.

best regards
Oct 4, 2007 at 2:48 PM
I have this error message :

he tag 'ViewWPF' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 2 Position 10.

i think something is misssing.
Oct 5, 2007 at 1:16 PM
Hi danisam,

Read more about XML->CLR namespace mapping here. And if you aren't familiar with XML namespaces, read this first.

Cheers,
Kent
Oct 5, 2007 at 3:00 PM
Thank you very much Kentcb