CodeDocu.com

C # Error: Control can not fall out of switch from final case label ('default:')

C # Error: Control can not 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);                        

                }

 

solution

You have to end each section at switch with break

                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

 


Software Entwicklung Stuttgart NĂ¼rtingen
Suche Projekte C#, WPF, Windows App,ASP.Net, vb.Net, WinForms, SQL Server, Access, Excel