private void BtnAdd_OnClick(object sender, RoutedEventArgs e) { try { var items = LayoutItemHelper.GenerateItemList(projFolderPath); var addPage = new AddPage(items, projFolderPath); MyFrame.Navigate(addPage); BtnAdd.IsEnabled = false; BtnExport.IsEnabled = BtnReceive.IsEnabled = BtnShare.IsEnabled = true; } catch { MessageBox.Show(this, "Invalid Configuration"); return; } }
public AddPage(List <LayoutItem> items, string projFolderPath) { InitializeComponent(); _items = items; this.projFolderPath = projFolderPath; foreach (var item in items) { MyPanel.Children.Add(LayoutItemHelper.GenerateLayout(item, projFolderPath)); if (item.Type == "ComboBox") { var cb = item.ControlItem as ComboBox; cb.DropDownClosed += delegate { if (cb.SelectedIndex >= 0) { UpdateItemSource(); } }; } } }