Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Creating bindable property on DataTemplateSelector

$
0
0

Getting error on trying to add property to DataTemplateSelector ie The name 'GetValue' does not exist in the current context

  class MyDataTemplateSelector : Xamarin.Forms.DataTemplateSelector
    {
        public DataTemplate QuestionType_Numeric { get; set; }

        public MyDataTemplateSelector()
        {
            this.QuestionType_Numeric = new DataTemplate(typeof(QuestionType_Numeric));
            CurrentItemEvent = new DelegateCommand<FormBatchResultModel>(CurrentItemEventHandler);
        }

        public static BindableProperty ParentBindingContextProperty =
            BindableProperty.Create(nameof(ParentBindingContext), typeof(object),
            typeof(MyDataTemplateSelector), null);

        public object ParentBindingContext
        {
            get { return GetValue(ParentBindingContextProperty); }//The name 'GetValue' does not exist in the current context

            set { SetValue(ParentBindingContextProperty, value); }
        }


        protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
        {
            Trace.TraceInformation($"----------------------------------------------OnSelectTemplate :: QuestionId[{((FormResultQuestionModel)item).QuestionId}] QuestionText[{((FormResultQuestionModel)item).QuestionText}]  QuestionTypeId[{((FormResultQuestionModel)item).QuestionTypeId}] ");


                    //this.QuestionType_Numeric.SetValue(etech.audit.Views.QuestionType_Numeric.DataProperty, Data);
                    return this.QuestionType_Numeric;

            }

        }

    }

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>