コード例 #1
0
 public CustomersHost()
 {
     InitializeComponent();
     Window = this;
     if (Properties.Settings.Default.User_AdvancedLogging)
     {
         Log.Commit("[CustomersHost] Loaded.");
     }
 }
コード例 #2
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;
            }
        }
コード例 #3
0
        /// <summary>
        /// Sets the content of the host control to the user control associated with this button
        /// </summary>
        /// <param name="sender">The button sending the data.</param>
        /// <param name="e">The data being sent, a click</param>
        private void ViewCustomersButton_Click(object sender, RoutedEventArgs e)
        {
            string Content = "ViewCustomers";

            CustomersHost.SetContent(Content);
        }