Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();

            PointsTable.ItemsSource = operatingDataSet;

            model = Plot.ActualModel;

            Type[]        typelist          = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace == "EstimationsAndPlots").ToArray();
            List <string> functionNamesList = new List <string>();

            foreach (Type type in typelist)
            {
                if (type.BaseType == Type.GetType("EstimationsAndPlots.Function"))
                {
                    functionNamesList.Add(type.Name);
                }
            }
            FunctionChoice.ItemsSource = functionNamesList;

            var myController = new PlotController();

            Plot.Controller = myController;

            myController.BindKeyDown(OxyKey.Right, OxyPlot.PlotCommands.PanLeft);
            myController.BindKeyDown(OxyKey.Left, OxyPlot.PlotCommands.PanRight);
            myController.BindKeyDown(OxyKey.Up, OxyPlot.PlotCommands.PanDown);
            myController.BindKeyDown(OxyKey.Down, OxyPlot.PlotCommands.PanUp);

            myController.UnbindMouseWheel();

            parametersTextBoxes.Add(P1);
            parametersTextBoxes.Add(P2);
            parametersTextBoxes.Add(P3);
            parametersTextBoxes.Add(P4);
            parametersTextBoxes.Add(P5);
            parametersTextBoxes.Add(P6);

            parametersTextBlocks.Add(T1);
            parametersTextBlocks.Add(T2);
            parametersTextBlocks.Add(T3);
            parametersTextBlocks.Add(T4);
            parametersTextBlocks.Add(T5);
            parametersTextBlocks.Add(T6);

            Maxiter.Text = maxiter.ToString();
            Eps.Text     = eps.ToString();

            this.model.MouseDown += (s, e) => this.Plot_MouseDown(s, e);
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            HeaderBackgroundUncheckedBrush = new SolidColorBrush(HeaderBackgroundUnchecked);
            HeaderBorderUncheckedBrush     = new SolidColorBrush(HeaderBorderUnchecked);
            HeaderBackgroundCheckedBrush   = new SolidColorBrush(HeaderBackgroundChecked);
            HeaderBorderCheckedBrush       = new SolidColorBrush(HeaderBorderChecked);

            details.HeaderBackground = HeaderBackgroundUncheckedBrush;
            details.HeaderBorder     = HeaderBorderUncheckedBrush;

            var plotController = new PlotController();

            plotController.UnbindMouseWheel();

            MainPlotView.Controller = plotController;
        }
Esempio n. 3
0
        public MainWindow()
        {
            InitializeComponent();

            PointsTable.ItemsSource     = operatingDataSet;
            ParametersTable.ItemsSource = operatingFunctionParameters;

            model = Plot.ActualModel;

            var typeNameList = dictionaryFunction.Keys;

            FunctionChoice.ItemsSource = typeNameList;

            typeNameList = dictionaryMetrics.Keys;
            MetricsChoice.ItemsSource = typeNameList;

            typeNameList = dictionaryMinimizer.Keys;
            MinimizerChoice.ItemsSource = typeNameList;

            var myController = new PlotController();

            Plot.Controller = myController;

            myController.BindKeyDown(OxyKey.Right, OxyPlot.PlotCommands.PanLeft);
            myController.BindKeyDown(OxyKey.Left, OxyPlot.PlotCommands.PanRight);
            myController.BindKeyDown(OxyKey.Up, OxyPlot.PlotCommands.PanDown);
            myController.BindKeyDown(OxyKey.Down, OxyPlot.PlotCommands.PanUp);

            myController.UnbindMouseWheel();

            MaxiterValue.Text = maxiter.ToString();
            EpsValue.Text     = eps.ToString();

            this.model.MouseDown += (s, e) => this.Plot_MouseDown(s, e);
            model.KeyDown        += (s, e) => Plot_KeyDown(s, e);
            model.MouseMove      += (s, e) => this.Plot_MouseMove(s, e);
            model.MouseUp        += (s, e) => this.Plot_MouseUp(s, e);
        }