5 Replies - 10734 Views - Last Post: 07 January 2013 - 03:39 PM Rate Topic: -----

#1 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5578
  • View blog
  • Posts: 11,918
  • Joined: 02-June 10

VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 05 January 2013 - 08:48 AM

I really can't figure out why this won't render at design time.
There is an error stating that an event can't be found or is inaccessible, yet the XAML editor is not underlining that line as an error and ReSharper shows the XAML as good.

Designer also feels that the enum doesn't exist, which it plainly does - and it uses it at runtime.

The event is public. The spelling and case is all correct. And the code works when run. Am I just missing something from staring at this too long?

UserControl named NavBar will be filled with buttons.
The .Tag of each button contains an enum value.
When the button is clicked it is routed to the MainWindow where the .Tag is used to determine which mode to enter.
The NavBar raises a RoutedEvent named NavigationModeSelected. That is the event the designer sees as both available and not available.

Mainwindow designer confused
Attached Image

Attached Image

Attached Image

If I comment out the NavBar the designer is happy again
Attached Image

Yet it all obviously works:
        private void NavBar_OnNavigationModeSelected(object sender, RoutedEventArgs e)
        {
            string demo = ((Button) (e.OriginalSource)).Tag.ToString();
            MessageBox.Show(demo);
        }


Attached Image

Error list says this doesn't exist - on the very page it is defined.
Attached Image


Attached Image


So the designer doesn't see a RoutedEvent that is public and that it does react to at runtime and doesn't see an enum that clearly exists. If these were genuine errors then it would fail to compile and execute - or at minimum wouldn't react to the event it claims it can't see and wouldn't correctly show the enum it claims doesn't exist.

Has anyone ever run across this type of craziness?

This post has been edited by tlhIn`toq: 05 January 2013 - 09:08 AM


Is This A Good Question/Topic? 0
  • +

Replies To: VS12 WPF Designer bug? Seems confused over what does and doesn't e

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1057
  • View blog
  • Posts: 4,097
  • Joined: 02-July 08

Re: VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 06 January 2013 - 10:35 PM

No, not yet. It might be worthy of submitting to Microsoft as a possible bug.

PS. I cannot see you images.
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5578
  • View blog
  • Posts: 11,918
  • Joined: 02-June 10

Re: VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 07 January 2013 - 09:05 AM

I wanted to see what the project did today before adding any more - but yesterday after a total restart the project behaved normally and didn't show any of the described confusion between what was and was not visible. I was hoping to find a way to cause the same confusion to see what the cause was - but couldn't do it.

On the day that I posted the bug I had restarted Visual Studio several times. But I had not powered the PC completely off. Its possible I have a memory stick going bad and under the right conditions it was making weirdness. There was also some issue with the classes .g.cs file which is supposed to be auto generated but seemed to never let go of some info.

At this point I'm ready to call it a non-reproducible goblin event and get on with life.



Not sure what's going on with photos. They were all there for two days. Then yesterday I noticed I couldn't add photos to a post in another thread: The uploader kept failing. Today the photos in this post are just gone.

The site feedback forum is filling up with reports of issues faster than they can be resolved. I have to completely dump browser caches daily or Safari renders nothing but the page footer. Many times I have to load a page 2-3 times before its right. Now this issue with images. Maybe I'll just take a couple weeks off from DIC and see if it stabilizes.
Was This Post Helpful? 0
  • +
  • -

#4 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 07 January 2013 - 12:56 PM

I've seen your posted images here, and yesterday have had similar issues with Firefox, seeing only page footer. But that happened only when I was accessing forums. Index page with scrolling videos and other stuff, worked just fine. Weird, and annoying things are going on at this site lately. I hope things will get better in a week or two.
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3614
  • View blog
  • Posts: 12,437
  • Joined: 12-December 12

Re: VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 07 January 2013 - 01:27 PM

You could get rid of that spare comma after ConnectedClients, although it seems unlikely to be the cause of any issue.
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5578
  • View blog
  • Posts: 11,918
  • Joined: 02-June 10

Re: VS12 WPF Designer bug? Seems confused over what does and doesn't e

Posted 07 January 2013 - 03:39 PM

View Postandrewsw, on 07 January 2013 - 02:27 PM, said:

You could get rid of that spare comma after ConnectedClients, although it seems unlikely to be the cause of any issue.


Not sure where you are referring - and now some of us can't see the images. Do you have a file and line number for that reference?

UPDATE: Found it. In the NavigationModes enum - Yeah, trailing commas in enums have no effect. I do this fairly regularly. Bad habit maybe, but it makes adding another value easy and you can select a line and comment it out without anything breaking.

But the very same code is happy now that the machine was shut down {over night} and rebooted. So I think it isn't so much a true bug in Visual Studio as some screwy condition on my machine that didn't go away by simply restarting the project or every VS itself. But once the machine dropped completely and came up fresh that same VS Solution works fine. Too, too strange.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1