private void PreparePicker()
        {
            this.NavigationItem.Title = "Add Expression";
            ExpressionConnected SelectedExpression;
            // Dynamically get a list of objects which are of type ExpressionConnected
            // Reference: https://stackoverflow.com/questions/981330/instantiate-an-object-with-a-runtime-determined-type
            var types = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace.StartsWith("FinalVersion", StringComparison.Ordinal));

            List <ExpressionConnected> StatExpressions = new List <ExpressionConnected>();

            foreach (var t in types)
            {
                if (t.IsSubclassOf(typeof(ExpressionConnected)))
                {
                    try
                    {
                        ExpressionConnected obj = (ExpressionConnected)Activator.CreateInstance(t, new object[] { false });

                        StatExpressions.Add(obj);
                    }
                    catch {
                        continue;
                    }
                }
            }

            var FormulaTable = new FormulaTable(StatExpressions);

            FormulaTable.SelectExpression += (sender, e) =>
            {
                SelectedExpression = FormulaTable.temp;
                //  PrepareInPutPicker(SelectedExpression);
                ViewInputTableControll inputview = this.Storyboard.InstantiateViewController("ViewInputTableControll") as ViewInputTableControll;
                inputview.seletedexpression = SelectedExpression;
                this.NavigationController.PushViewController(inputview, true);
            };
            ViewFormulaTable.Source = FormulaTable;
            //var picker = new UIPickerView
            //{
            //    Frame = new CGRect(10, 10, 350,
            //            300),
            //};
            ////var findValuePickerModel = new FindValuePickerModel(StatExpressions);
            //findValuePickerModel.GetSelectedExpression += (sender, e) =>
            //{

            //    SelectedExpression = findValuePickerModel.Ex1;
            //    PrepareInPutPicker();

            //};
            //picker.Model = findValuePickerModel;

            //picker.ShowSelectionIndicator = true;
            //this.View.AddSubview(picker);
        }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (FormulaTable != null)
            {
                FormulaTable.Dispose();
                FormulaTable = null;
            }

            if (lb1 != null)
            {
                lb1.Dispose();
                lb1 = null;
            }
        }