예제 #1
0
        void PlotCanvas_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if ((DataContext != null) && (DataContext is PlotGenerator))
            {
                plot = (PlotGenerator)DataContext;

                UpdatePlot();
            }
        }
예제 #2
0
        public MainWindow()
        {
            plot = new PlotGenerator();
            plot.Compile();

            double x = Math.Sin(1.0);

            this.DataContext = this;

            InitializeComponent();

            StartValueTextBox.DataContext = plot.StartValueFunction;
            EndValueTextBox.DataContext   = plot.EndValueFunction;

            AddFunctionButton.Click += new RoutedEventHandler(AddFunctionButton_Click);
            UpdateButton.Click      += new RoutedEventHandler(UpdateButton_Click);
        }