Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody,

This is a very quick question: I'm using VS13 Express for Windows Store and I'm experimenting something strange: if I edit a XAML file, the .cs file "loses the link" with the XAML one. It means that it does not recognize InitializeComponent and none of the controls in the page. Then, if I hit "Save all" it works properly until I edit something again, and I will have to hit save all again.

Is it normal or I have to repair the installation?

Thanks!!

Jymmy097
Posted
Comments
Sergey Alexandrovich Kryukov 18-Feb-14 18:04pm    
InitializeComponent does not have to be "recognized". It is either generated by your designer or not, either called from your constructor or not. Hard to say what's going on...
—SA
LLLLGGGG 19-Feb-14 7:41am    
Thanks. What I mean is that when I switch from my xaml file to my cs file and I have modified the xaml one, the InitializeComponent isn't recognized (in sense that it seems like doesn't exists and the controls too) until I save all. But if I compile, no error is thrown... Is it a normal behaviour or I have to repair my vs installation? It might be a conflict with VS 2012? Thanks a lot!
Sergey Alexandrovich Kryukov 19-Feb-14 10:42am    
I did not work with WinRT, but in WPF you program with XAML, and there is no InitializeComponent; instead, window code is generated as source code outside of the source code tree. InitializeComponent is generated in System.Windows.Forms only. Why do you think there is such method at all?
—SA
LLLLGGGG 19-Feb-14 11:31am    
Because it is integrated in the template of a basic window... I'll post here the xaml and the cs file of a new window as soon as I'll have access to my terminal: now I'm writing with a tablet.
LLLLGGGG 19-Feb-14 14:30pm    
This is a screenshot after an edit to the xaml file
http://i62.tinypic.com/28hipw9.png

This is after I have saved all
http://i58.tinypic.com/5ulf1s.png

The empty mainpage (by default) contains the ctor for mainpage with initializecomponents inside it.

EDIT: I noticed that if I make some minor edits to my xaml file (such as adding a control), there isn't any problem; but if I create an event handler, the problem exists. (Sorry but I'm tired now and I can write only with a bad Englis!!).

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