Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

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

$
0
0
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






If I comment out the NavBar the designer is happy again


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




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






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?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>