OxyPlot InvalidatePlot不适用于recyclerview

时间:2018-03-06 22:51:36

标签: c# xamarin xamarin.android mvvmcross oxyplot

我使用mvvmcross和绑定oxyplot如下,但使用InvalidatePlot刷新情节不起作用。

XML

<RelativeLayout
   android:layout_width="fill_parent"
   android:layout_height="match_parent">
     <oxyplot.xamarin.android.PlotView
         android:id="@+id/chart_data"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         local:MvxBind="Model PlotModel" />
</RelativeLayout> 

ClassroomViewRecyclerAdapter.cs

public class ClassroomViewRecyclerAdapter: MvxRecyclerAdapter
{
    private readonly FragmentActivity _activity;
    private readonly IMvxAndroidBindingContext _bindingContext;
    public PlotView cardPlotView ;

   public ClassroomViewRecyclerAdapter(IMvxAndroidBindingContext bindingContext, FragmentActivity activity)
        : base(bindingContext)
   {
        _activity = activity;
        _bindingContext = bindingContext;
   }
   public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
   {
     base.OnBindViewHolder(holder, position);
     var view = holder.ItemView;
     cardPlotView = view.FindViewById<PlotView>(Resource.Id.chart_data);
     cardPlotView.InvalidatePlot(true);
   }
}

0 个答案:

没有答案