private static UserControl GetUserControlByName(string name)
        {
            UserControl resControl;

            switch (name)
            {
            case "ItemFirstPage":
                resControl = new UserControlFirstPage();
                break;

            case "ItemPerformances":
                resControl = new UserControlPerformances();
                break;

            case "ItemPrices":
                resControl = new UserControlPrices();
                break;

            case "ItemTour":
                resControl = new UserControlTour();
                break;

            case "ItemBasket":
                resControl = new UserControlBasket();
                break;

            case "ItemSubscribers":
                resControl = new UserControlSubscribers();
                break;

            case "ItemAboutUs":
                resControl = new UserControlAboutUs();
                break;

            case "ItemContact":
                resControl = new UserControlContact();
                break;

            case "ItemStars":
                resControl = new UserControlStars();
                break;

            default:
                resControl = new UserControlFirstPage();
                break;
            }
            return(resControl);
        }
        private void SeeTours_Btn(object sender, RoutedEventArgs e)
        {
            UserControl usc;

            if (Performance_lv.SelectedItem != null)
            {
                Performance selectedPerformance = (Performance)Performance_lv.SelectedItem;
                usc = new UserControlTour(selectedPerformance);
            }
            else
            {
                usc = new UserControlTour();
            }

            this.Content = usc;
        }
示例#3
0
        private void TourGrid_Click(object sender, MouseButtonEventArgs e)
        {
            UserControl usc = new UserControlTour();

            this.Content = usc;
        }