예제 #1
0
        /// <summary>
        /// Sets the content of the main content section of the window.
        /// </summary>
        /// <param name="Content">The usercontrol that is to be loaded.</param>
        public static void SetContent(string Content)
        {
            switch (Content)
            {
            case "Reviews":
                //Set the content
                Window.MainContent.Content = new WebsiteHost();
                //Set the toolbar
                Window.ToolbarContent.Content = new WebsiteToolbar();
                //Set the specific content on the host control.
                WebsiteHost.SetContent(Content);
                break;

            case "Costs":
                Window.MainContent.Content    = new FinancesHost();
                Window.ToolbarContent.Content = new FinancesToolbar();
                FinancesHost.SetContent(Content);
                break;

            case "Prices":
                Window.MainContent.Content    = new FinancesHost();
                Window.ToolbarContent.Content = new FinancesToolbar();
                FinancesHost.SetContent(Content);
                break;

            case "Bookings":
                Window.MainContent.Content    = new BookingsHost();
                Window.ToolbarContent.Content = new BookingsToolbar();
                BookingsHost.SetContent(Content);
                break;

            case "ViewCustomers":
                Window.MainContent.Content    = new CustomersHost();
                Window.ToolbarContent.Content = new CustomersToolbar();
                CustomersHost.SetContent(Content);
                break;

            case "Tasks":
                Window.MainContent.Content    = new TasksHost();
                Window.ToolbarContent.Content = new TasksToolbar();
                TasksHost.SetContent(Content);
                break;
            }
        }
예제 #2
0
        private void Bookings_Click(object sender, RoutedEventArgs e)
        {
            string Content = "Bookings";

            BookingsHost.SetContent(Content);
        }