public MainWindow()
        {
            InitializeComponent();

            engine      = new OP_CompositionEngine();
            ContextData = new MainWindowData();
            DataContext = ContextData;

            /*
             * AllOPLists = new ObservableCollection<op_stct2>();
             * targetOPList = new ObservableCollection<op_stct2>();
             *
             * //OPリスト追加
             * foreach (op_stct2 o in OPDataContainer.GetAllOP())
             * {
             *  AllOPLists.Add(o);
             * }
             */

            OP_ListBox.ItemsSource       = ContextData.AllOPLists;
            TargetOP_ListBox.ItemsSource = ContextData.targetOPList;

            CampaignOP_Percent_Combobox.ItemsSource   = ContextData.CampaignAdd;
            CampaignOP_Percent_Combobox.SelectedIndex = 0;

            OP_ParcentAdd_ComboBox.ItemsSource   = ContextData.ItemAdd;
            OP_ParcentAdd_ComboBox.SelectedIndex = 0;
        }
        private void Add_OP_Button_Click(object sender, RoutedEventArgs e)
        {
            var selectOP = OP_ListBox.SelectedItem;

            if (selectOP is op_stct2)
            {
                op_stct2 op = (op_stct2)selectOP;
                ContextData.targetOPList.Add(op);

                var isDuped = OP_CompositionEngine.checkOP(ContextData.targetOPList.ToList());
                if (isDuped.Count != 0)
                {
                    foreach (var op_d in isDuped)
                    {
                        ContextData.targetOPList.Remove(op_d);
                    }
                    ContextData.targetOPList.Add(op);
                }

                if (ContextData.targetOPList.Count == 8)
                {
                    Add_OP_Button.IsEnabled = false;
                }

                Remove_OP_Button.IsEnabled = true;
                StartButton.IsEnabled      = true;
            }

            TargetOP_ListBox.ItemsSource = ContextData.targetOPList;
        }
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            material m         = OP_CompositionEngine.SerchOP(ContextData.targetOPList.ToArray());
            var      tree_page = TreeFrame.Content;

            if (tree_page is OP_TreePage)
            {
                var page = (OP_TreePage)tree_page;
                page.ShowMaterialTree(m);
                //Console.WriteLine("FrameViewBox Width:{0}, Height:{1}", TreeFrame_ViewBox.Width, TreeFrame_ViewBox.Height);

                double edge_X = Width - (TreeFrameBoader.Margin.Left + TreeFrameBoader.Margin.Right);
                double edge_Y = Height - (TreeFrameBoader.Margin.Top + TreeFrameBoader.Margin.Bottom);
                TreeFrame_ViewBox.Width  = edge_X;
                TreeFrame_ViewBox.Height = edge_Y;
            }
        }