#

C# Fehler: Control cannot fall out of switch from final case label ('default:')

 

                NavigationViewItem item = args.SelectedItem as NavigationViewItem;

                String sSelected = item.Tag.ToString();

                switch (sSelected )

                {

                    case "camControllers":

                        ContentFrame.Navigate(typeof(CamControllers));

                        break;

                    default:

                        ContentFrame.Navigate(null);                        

                }

 

Lösung

Man muss jeden Abschnitt bei switch mit break beenden

                NavigationViewItem item = args.SelectedItem as NavigationViewItem;

                String sSelected = item.Tag.ToString();

                switch (sSelected )

                {

                    case "camControllers":

                        ContentFrame.Navigate(typeof(CamControllers));

                        break;

                    default:

                        ContentFrame.Navigate(null);

                        break;

                }

 

 

 

Severity

Code

Description

Project

File

Line

Suppression State

Error

CS8070

Control cannot fall out of switch from final case label ('default:')

Win10_WebCam_on_Top

C:\_Daten\Desktop\VS_Projects\UWP\Win10_WebCam_on_Top\Win10_WebCam_on_Top\MainPage.xaml.cs

996

Active

 

Mobile

.

yesmovies