예제 #1
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl control = null;

            GridMain.Children.Clear();

            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ItemHome":
                control = new UserControlHome();
                GridMain.Children.Add(control);
                break;

            case "ItemCreate":
                control = new UserControlSupplier();
                GridMain.Children.Add(control);
                break;

            default:
                break;
            }
        }
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl usc = null;

            GridMain.Children.Clear();

            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ItemHome":
                usc = new UserControlHome();
                GridMain.Children.Add(usc);
                break;

            case "Item":
                usc = new UserControlItem();
                GridMain.Children.Add(usc);
                break;

            case "Supplier":
                usc = new UserControlSupplier();
                GridMain.Children.Add(usc);
                break;

            case "Transaction":
                usc = new UserControlTransaction();
                GridMain.Children.Add(usc);
                break;

            case "TransactionItem":
                usc = new UserControlTransactionItem();
                GridMain.Children.Add(usc);
                break;

            default:
                break;
            }
        }