我使用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);
}
}