private void CarouselItem_OnBindingContextChanged(object sender, EventArgs e) { _viewModel = BindingContext as ColumnVM; if (_viewModel == null) { return; } _viewModel.DisplayExceptionMessage = (exMessage) => Application.Current.MainPage.DisplayAlert(AppResources.Error, exMessage, AppResources.Ok); }
public static ColumnPainter Create(UIElement headerView, ColumnView view, ColumnVM vm) { if (vm is BoundaryEditorColumnVM) { BoundaryEditorColumnVM becVM = (BoundaryEditorColumnVM)vm; ILayerBoundariesVM lbVM = becVM.BoundariesVM; if (becVM.ColumnVM is BoundaryLineColumnVM) { BoundaryLineColumnVM blcVM = (BoundaryLineColumnVM)becVM.ColumnVM; lbVM = blcVM.BoundariesVM; if (blcVM.ColumnVM is BoundaryLabelColumnVM) { BoundaryLabelColumnVM blcVM2 = (BoundaryLabelColumnVM)blcVM.ColumnVM; lbVM = blcVM2.BoundariesVM; } } return(new BoundaryColumnPainter(headerView, view, vm, lbVM)); } else if (vm is BoundaryLineColumnVM) { BoundaryLineColumnVM blcVM = (BoundaryLineColumnVM)vm; return(Create(headerView, view, blcVM.ColumnVM)); } else if (vm is ImageColumnVM) { return(new ImageColumnPainter(headerView, view, (ImageColumnVM)vm)); } else if (vm is DepthAxisColumnVM) { return(new DepthColumnPainter(headerView, view, (DepthAxisColumnVM)vm)); } else if (vm is ILayerColumn) { return(new LayeredColumnPainter(headerView, view, vm, (ILayerColumn)vm, universalLayerPainter)); } else if (vm is SamplesColumnVM) { return(new SamplesColumnPainter(headerView, view, (SamplesColumnVM)vm)); } else if (vm is VisualColumnVM) { return(new VisualColumnPainter(headerView, view, (VisualColumnVM)vm)); } else { return(new ColumnPainter(headerView, view, vm)); } }
private void LvTasks_OnItemDragging(object sender, ItemDraggingEventArgs e) { if (e.Action == DragAction.Drop) { ColumnVM column = _viewModel.SelectedBoard.ColumnsCollection[_viewModel.SelectedColumnPosition]; TaskVM task = e.ItemData as TaskVM; if (column == null || task == null) { return; } _viewModel.MoveTask(task.Id, column.Id, e.NewIndex); } }
public BoundaryColumnVM(ColumnVM targetColumn, ILayerBoundariesVM boundariesVM) : base(targetColumn.Heading) { ColumnVM = targetColumn; BoundariesVM = boundariesVM; PropertyChanged += BoundaryLineColumnVM_PropertyChanged; }
public BoundaryColumnPainter(UIElement headerView, ColumnView view, ColumnVM vm, ILayerBoundariesVM boundariesVM) : base(headerView, view, vm) { this.vm = boundariesVM; }
public LayeredColumnPainter(UIElement headerView, ColumnView view, ColumnVM vm, ILayerColumn columnVm, ILayerPainter layerPainter) : base(headerView, view, vm) { this.columnVm = columnVm; this.layerPainter = layerPainter; }