private void listBox_Button_Set() { bxs = new BoxExchangeEditor(null, this.listBox_serviceView, true, true, true, true); bxs.ItemComparer = ServiceViewItem.Comparator; //サービス選択関係はソースの ListView が複数あるので、全ての ListViewItem にイベントを追加する。 foreach (TabItem tab in tab_ServiceList.Items) { var box = tab.Content as ListView; bxs.sourceBoxAllowCancelAction(box); bxs.sourceBoxAllowDragDrop(box); bxs.sourceBoxAllowKeyAction(box); bxs.sourceBoxAllowDoubleClick(box); } //ソースのリストボックスは複数あるので、リストボックスが選択されたときに SourceBox の登録を行う tab_ServiceList.SelectionChanged += (sender, e) => { try { bxs.SourceBox = ((sender as TabControl).SelectedItem as TabItem).Content as ListView; } catch { bxs.SourceBox = null; } }; button_service_addAll.Click += (sender, e) => button_AddAll(); button_service_add.Click += new RoutedEventHandler(bxs.button_Add_Click); button_service_ins.Click += new RoutedEventHandler(bxs.button_Insert_Click); button_service_del.Click += new RoutedEventHandler(bxs.button_Delete_Click); button_service_delAll.Click += new RoutedEventHandler(bxs.button_DeleteAll_Click); button_service_top.Click += new RoutedEventHandler(bxs.button_Top_Click); button_service_up.Click += new RoutedEventHandler(bxs.button_Up_Click); button_service_down.Click += new RoutedEventHandler(bxs.button_Down_Click); button_service_bottom.Click += new RoutedEventHandler(bxs.button_Bottom_Click); //ジャンル選択関係 var bxj = new BoxExchangeEditor(this.listBox_jyanru, this.listBox_jyanruView, true, true, true, true); button_jyanru_addAll.Click += new RoutedEventHandler(bxj.button_AddAll_Click); button_jyanru_add.Click += new RoutedEventHandler(bxj.button_Add_Click); button_jyanru_ins.Click += new RoutedEventHandler(bxj.button_Insert_Click); button_jyanru_del.Click += new RoutedEventHandler(bxj.button_Delete_Click); button_jyanru_delAll.Click += new RoutedEventHandler(bxj.button_DeleteAll_Click); button_jyanru_top.Click += new RoutedEventHandler(bxj.button_Top_Click); button_jyanru_up.Click += new RoutedEventHandler(bxj.button_Up_Click); button_jyanru_down.Click += new RoutedEventHandler(bxj.button_Down_Click); button_jyanru_bottom.Click += new RoutedEventHandler(bxj.button_Bottom_Click); }