private void DrawCurrentTimeLine() { var currentTimeLine = scheduleContainer.FindViewWithTag("currentTimeLine"); if (currentTimeLine != null) { var parameters = currentTimeLine.LayoutParameters as FrameLayout.LayoutParams; parameters.TopMargin = GetMarginTop(); currentTimeLine.LayoutParameters = parameters; } else { currentTimeLine = new View(gridContainer.Context); currentTimeLine.Tag = "currentTimeLine"; currentTimeLine.SetBackgroundColor(Color.Black); var parameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 4); parameters.TopMargin = GetMarginTop(); currentTimeLine.LayoutParameters = parameters; scheduleContainer.AddView(currentTimeLine); } //while (!token.IsCancellationRequested) //{ // var currentTimeLine = scheduleContainer.FindViewWithTag("currentTimeLine"); // if (currentTimeLine != null) // { // var parameters = currentTimeLine.LayoutParameters as FrameLayout.LayoutParams; // parameters.TopMargin = GetMarginTop(); // currentTimeLine.LayoutParameters = parameters; // } // else // { // currentTimeLine = new View(gridContainer.Context); // currentTimeLine.Tag = "currentTimeLine"; // currentTimeLine.SetBackgroundColor(Color.Black); // var parameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 4); // parameters.TopMargin = GetMarginTop(); // currentTimeLine.LayoutParameters = parameters; // scheduleContainer.AddView(currentTimeLine); // } // await Task.Delay(interval, token); //} }
private View ViewForStructure(StructureObj theStruct) { return(structureGrid.FindViewWithTag(theStruct.Id)); }