//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_dynamiclistview); DynamicListView listView = (DynamicListView)FindViewById(Resource.Id.activity_dynamiclistview_listview); listView.AddHeaderView(LayoutInflater.From(this).Inflate(Resource.Layout.activity_dynamiclistview_header, listView, false)); /* Setup the adapter */ Com.Nhaarman.ListviewAnimations.ArrayAdapter <string> adapter = new MyListAdapter(this); SimpleSwipeUndoAdapter simpleSwipeUndoAdapter = new SimpleSwipeUndoAdapter(adapter, this, new MyOnDismissCallback(adapter, this)); AlphaInAnimationAdapter animAdapter = new AlphaInAnimationAdapter(simpleSwipeUndoAdapter); animAdapter.setAbsListView(listView); //assert animAdapter.getViewAnimator() != null; animAdapter.getViewAnimator().setInitialDelayMillis(INITIAL_DELAY_MILLIS); listView.SetAdapter(animAdapter); /* Enable drag and drop functionality */ listView.enableDragAndDrop(); listView.setDraggableManager(new TouchViewDraggableManager(Resource.Id.list_row_draganddrop_touchview)); listView.setOnItemMovedListener(new MyOnItemMovedListener(adapter, this)); listView.OnItemLongClickListener = new MyOnItemLongClickListener(listView); /* Enable swipe to dismiss */ listView.enableSimpleSwipeUndo(); /* Add new items on item click */ listView.OnItemClickListener = new MyOnItemClickListener(listView, this); }
/*START MY CODE*/ // // private void CreateListItem() { CalculateAvgUrine(); ListOfFluidDataPts.Add(new AFRDataPoint(Publictime, realAvgValue.ToString("0.##") + " mL", OngoingRate.ToString("0.##") + " mL/kg/h")); //listofmydatapoints = MyList; // DeviceListSource.Source = listOfDevices; MyDataPtsSource.Source = ListOfFluidDataPts; DynamicListView.Focus(FocusState.Programmatic); DynamicListView.SelectedIndex = (DynamicListView.Items.Count - 1); DynamicListView.ScrollIntoView(DynamicListView.SelectedItem); //TEST CODE NEW START //ListViewItem NewItem = DynamicListView.ItemContainerGenerator.ContainerFromItem(DynamicListView.SelectedItem) as ListViewItem; /* * if (rowFormatToggle == true) * { * this.Resources[HighlightBrushKey] = Brushes.Red; * //NewItem.Background = new SolidColorBrush(Color.FromArgb(255, 248, 203, 173)); * rowFormatToggle = false; * } * else * { * //NewItem.Background = new SolidColorBrush(Color.FromArgb(255, 252, 228, 214)); * rowFormatToggle = true; * } */ //END NEW TEST CODE }
private void Bind(DynamicListView <T> newElement) { if (newElement != null) { this.tableView.ItemsSource = this.Element.Data; newElement.PropertyChanged += ElementPropertyChanged; } }
private void Bind(DynamicListView <T> newElement) { if (newElement != null) { newElement.PropertyChanging += ElementPropertyChanging; newElement.PropertyChanged += ElementPropertyChanged; newElement.Data.CollectionChanged += DataCollectionChanged; } }
private void Unbind(DynamicListView <T> oldElement) { if (oldElement != null) { oldElement.PropertyChanging += ElementPropertyChanging; oldElement.PropertyChanged -= ElementPropertyChanged; oldElement.Data.CollectionChanged += DataCollectionChanged; } }
private void Unbind(DynamicListView <T> oldElement) { if (oldElement != null) { oldElement.PropertyChanged -= ElementPropertyChanged; } this.tableView.ItemsSource = null; }
public MyOnItemClickListener(DynamicListView listView, DynamicListViewActivity instance) { mListView = listView; minstance = instance; }
public MyOnItemLongClickListener(DynamicListView listView) { mListView = listView; }
public DynamicListViewWrapper(DynamicListView dynamicListView) { mDynamicListView = dynamicListView; }
/** * Creates a new {@code DragAndDropHandler} for given {@link com.nhaarman.listviewanimations.itemmanipulation.DynamicListView}. * * @param dynamicListView the {@code DynamicListView} to use. */ public DragAndDropHandler(DynamicListView dynamicListView) : this(new DynamicListViewWrapper(dynamicListView)) { }