예제 #1
0
        public FunctionPlotter(IPainter painter, IFunction function, FunctionPlotterViewModel model)
        {
            Ensure.Arg(painter).IsNotNull();
            Ensure.Arg(function).IsNotNull();
            Ensure.Arg(model).IsNotNull();

            _painter  = painter;
            _function = function;
            _model    = model;

            Ensure.Arg(painter == _painter);
            Ensure.Arg(function == _function);
            Ensure.Arg(model == _model);
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();
            InitFunctionsComboBox();
            InitOperatorsComboBox();
            InitVariableComboBox();
            SetGlobalExceptionHandling();
            SetValidator();

            FunctionsComboBox.SelectionChanged += HandleSelectionChanged;
            FunctionsComboBox.DropDownOpened   += HandleDropDownOpened;

            OperatorsComboBox.SelectionChanged += HandleSelectionChanged;
            OperatorsComboBox.DropDownOpened   += HandleDropDownOpened;

            VariableComboBox.SelectionChanged += HandleSelectionChangedOnVariable;
            VariableComboBox.DropDownOpened   += HandleDropDownOpened;

            SizeChanged += Draw_OnClick;

            PlotterViewModel = new FunctionPlotterViewModel();
            DataContext      = PlotterViewModel;
        }