public CreateDefectContentPage(int cIsso, int cGrConstr, string description, IReadOnlyList <object> args) { InitializeComponent(); Title = $"{description}. Выбор параметров дефекта."; var defectModel = new CreateDefectModel { CIsso = cIsso, CGrConstr = cGrConstr, Description = description, CDefect = (int)args[0], NDefect = (string)args[1], ParentTreeNode = ((Ais7DefectItem)args[2]).Parent }; defectModel.DefectParameters = Ais7DefectParamValue.ReturnDefectParameters(defectModel.CDefect, defectModel.CGrConstr); BindingContext = _vm = new CreateDefectViewModel(defectModel); // Прописываем, какие индексы у страниц для удобства _indexAdvanced = CarouselView.ItemsSource.Cast <ContentView>().IndexOf(page => page is AdditionalDefectParametersContentView); _indexSummary = CarouselView.ItemsSource.Cast <ContentView>().IndexOf(page => page is SummaryDefectContentView); _indexQuality = CarouselView.ItemsSource.Cast <ContentView>().IndexOf(page => page is QualityParametersTreeView); _indexQuantity = CarouselView.ItemsSource.Cast <ContentView>().IndexOf(page => page is QuantityParametersContentPage); // Последнему разрешаем работу с кнопкой с самого начала _interactors = new List <bool>(new bool[_indexSummary + 1]) { [_indexSummary] = true }; MessagingCenter.Subscribe <Tuple <DefectType, bool> >(this, "InteractionChanged", (interact) => InteractionChanged(interact, EventArgs.Empty)); ButtonForward.IsEnabled = false; }
public QualityParametersTreeView(CreateDefectModel defectModel) { InitializeComponent(); var page = new LoadingPopupPage("Пожалуйста, подождите...", true); Navigation.PushPopupAsync(page, false); Task.Factory.StartNew(() => { var stackLayout = new StackLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical }; TreeStackLayout.Content = stackLayout; var mainDefect = new ParamTreeView(defectModel); stackLayout.Children.Add(mainDefect); //foreach (var child in defectModel.DefectParameters) // stackLayout.Children.Add(new DefectTreeView(cIsso, child, false)); Device.BeginInvokeOnMainThread(() => { Navigation.PopPopupAsync(); BindingContext = new QualityParametersTreeViewModel(); }); }); }
public DateDefectContentView(CreateDefectModel defectModel) { InitializeComponent(); BindingContext = _vm = new DateDefectContentViewModel(defectModel); MyCalendar.SelectedDate = null; //_vm.DateNotChanged += delegate(object sender, EventArgs args) //{ // var date = Convert.ToDateTime(sender); // var date1 = date.AddDays(1); // MyCalendar.SelectedDates.Add(date1); //}; }
private void CreateFrameInfo(CreateDefectModel defectModel) { var quantityParams = defectModel.DefectParameters.Where(item => !item.IsQual).ToList(); //Добавляем количественные параметры foreach (var parameter in quantityParams) { GridQuantityInfo.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star }); GridQuantityInfo.Children.Add(GetTextLayout(parameter.GetValueRange), 0, quantityParams.IndexOf(parameter)); GridQuantityInfo.Children.Add(GetTextLayout(parameter.GetBdrg), 1, quantityParams.IndexOf(parameter)); } }
public ParamTreeView(CreateDefectModel vm) { ViewModel = new ParamsTreeModel(vm); NodeCreationFactory = () => new TreeNodeView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start, }; HeaderCreationFactory = () => new ParamDefectItemView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Start }; BindingContext = ViewModel.Tree; }
public AdditionalDefectParametersContentView(CreateDefectModel defectModel) { InitializeComponent(); BindingContext = new AdditionalDefectParametersContentViewModel(defectModel); }
public QuantityParametersContentPage(CreateDefectModel defectModel) { InitializeComponent(); BindingContext = new QuantityParametersContentPageModel(defectModel); CreateFrameInfo(defectModel); }
public SummaryDefectContentView(CreateDefectModel defectModel) { InitializeComponent(); Vm = new SummaryDefectContentViewModel(defectModel); BindingContext = Vm; }