Freigeben über


Beispielcode für die Debuggernavigation (XAML und C#)

Der Code in diesem Thema ist die Beispieldatei für das Thema Schnellstart: Debuggernavigation (XAML und C#).

Beispielcode

        public MainPage()
        {
            InitializeComponent();
            methodTrack = "Main Page";           
            Example1();
        }


        int Example1()
        {
            int a = 1;
            methodTrack += "->Example1 ";
            int x = Example1_A();
            return a;
        }

        int Example1_A()
        {
            int b = 2;
            methodTrack += "->Example1_B ";
            return b;
        }


        void Example2()
        {
            int c = 3;
            methodTrack += "->Example2 ";
            int x = Example2_A();
            int y = Example2_A();
            int z = Example2_B();
        }

        int Example2_A()
        {
            int c = 3;
            methodTrack += "->Example2_A ";
            return c;
        }

        int Example2_B()
        {
            int d = 3;
            methodTrack += "->Example2_B ";
            return d;
        }

        void Example3()
        {
            string s = String.Empty;
            for (int i = 0; i < 1000; i++)
            {
                s += i.ToString() + '\n';
            }
            methodTrack += "->Example3 ";

        }

        void Example4()
        {
            int x = 0;
            int y = 100;
            if (x != 0)
            {
                x = 1;
            }
            double result = y / x;
            methodTrack = "->Example4";
        }

        string methodTrack = String.Empty;