コード例 #1
0
        public KanbanCustomizationSample()
        {
            model = new KanbanCustomViewModel();
            InitializeComponent();
            kanban.BindingContext = model;
            column1.Categories    = new List <object>()
            {
                "Menu"
            };
            column2.Categories = new List <object>()
            {
                "Dining", "Delivery"
            };
            column3.Categories = new List <object>()
            {
                "Ready to Serve"
            };
            column4.Categories = new List <object>()
            {
                "Door Delivery"
            };

            KanbanErrorBarSettings errorBar = new KanbanErrorBarSettings();

            errorBar.Height             = 2;
            errorBar.Color              = Color.FromRgb(179.0f / 255.0f, 71.0f / 255.0f, 36.0f / 255.0f);
            errorBar.MaxValidationColor = Color.FromRgb(211.0f / 255.0f, 51.0f / 255.0f, 54.0f / 255.0f);
            errorBar.MinValidationColor = Color.FromRgb(67.0f / 255.0f, 188.0f / 255.0f, 131.0f / 255.0f);

            column1.ErrorbarSettings = column2.ErrorbarSettings = column3.ErrorbarSettings
                                                                      = column4.ErrorbarSettings = errorBar;

            KanbanPlaceholderStyle style = new KanbanPlaceholderStyle();

            style.SelectedBackgroundColor = Color.FromRgb(250.0f / 255.0f, 199.0f / 255.0f, 173.0f / 255.0f);
            kanban.PlaceholderStyle       = style;

            List <KanbanWorkflow> flows = new List <KanbanWorkflow>();

            flows.Add(new KanbanWorkflow("Menu", new List <object>()
            {
                "Dining", "Delivery"
            }));
            flows.Add(new KanbanWorkflow("Dining", new List <object>()
            {
                "Ready to Serve"
            }));
            flows.Add(new KanbanWorkflow("Delivery", new List <object>()
            {
                "Door Delivery"
            }));
            flows.Add(new KanbanWorkflow("Ready to Serve", new List <object>()
            {
            }));
            flows.Add(new KanbanWorkflow("Door Delivery", new List <object>()
            {
            }));

            kanban.Workflows = flows;
        }
コード例 #2
0
        public CustomizationKanban()
        {
            kanban = new SfKanban();

            KanbanErrorBarSettings errorBar = new KanbanErrorBarSettings();

            errorBar.Height             = 2;
            errorBar.Color              = UIColor.FromRGB(179.0f / 255.0f, 71.0f / 255.0f, 36.0f / 255.0f);
            errorBar.MaxValidationColor = UIColor.FromRGB(211.0f / 255.0f, 51.0f / 255.0f, 54.0f / 255.0f);
            errorBar.MinValidationColor = UIColor.FromRGB(67.0f / 255.0f, 188.0f / 255.0f, 131.0f / 255.0f);

            KanbanPlaceholderStyle style = new KanbanPlaceholderStyle();

            style.SelectedBackgroundColor = UIColor.FromRGB(250.0f / 255.0f, 199.0f / 255.0f, 173.0f / 255.0f);
            kanban.PlaceholderStyle       = style;

            KanbanColumn column1 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Menu"
                }
            };

            column1.Title            = "Menu";
            column1.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column1);

            KanbanColumn column2 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Dining", "Delivery"
                }
            };

            column2.Title            = "Order";
            column2.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column2);

            KanbanColumn column3 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Ready to Serve"
                }
            };

            column3.Title            = "Ready to Serve";
            column3.AllowDrag        = false;
            column3.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column3);

            KanbanColumn column4 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Door Delivery"
                }
            };

            column4.Title            = "Delivery";
            column4.AllowDrag        = false;
            column4.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column4);

            kanban.ItemsSource = this.ItemsSourceCards();

            List <KanbanWorkflow> flows = new List <KanbanWorkflow>();

            flows.Add(new KanbanWorkflow("Menu", new List <object>()
            {
                "Dining", "Delivery"
            }));
            flows.Add(new KanbanWorkflow("Dining", new List <object>()
            {
                "Ready to Serve"
            }));
            flows.Add(new KanbanWorkflow("Delivery", new List <object>()
            {
                "Door Delivery"
            }));
            flows.Add(new KanbanWorkflow("Ready to Serve", new List <object>()
            {
            }));
            flows.Add(new KanbanWorkflow("Door Delivery", new List <object>()
            {
            }));

            kanban.Workflows = flows;

            kanban.DragStart += (object sender, KanbanDragStartEventArgs e) =>
            {
                if ((e.Data as KanbanModel).Category.ToString() == "Menu")
                {
                    e.KeepItem = true;
                }
            };

            kanban.DragEnd += (object sender, KanbanDragEndEventArgs e) =>
            {
                if (e.TargetColumn != null && e.SourceColumn.Categories.Contains("Menu"))
                {
                    e.Cancel = true;
                    e.TargetColumn.InsertItem(CloneModel((e.Data as KanbanModel), e.TargetCategory), e.TargetIndex);
                }

                else if (e.TargetColumn != null && e.TargetCategory != null)
                {
                    (e.Data as KanbanModel).Category = e.TargetCategory;
                }
            };

            this.AddSubview(kanban);
        }
コード例 #3
0
        public KanbanCustomizationSample()
        {
            InitializeComponent();
            //if (App.Platform != Platforms.UWP)
            //	Xamarin.Forms.DependencyService.Get<IKanbanDependencyService>().ApplyBarColor();
            kanban.BindingContext = model;
            //if (App.Platform == Platforms.UWP)
            //{
            //	labelLayout.HeightRequest = 50;
            //	labelLayout.IsVisible = true;
            //}

            column1.Categories = new List <object>()
            {
                "Menu"
            };
            column2.Categories = new List <object>()
            {
                "Dining", "Delivery"
            };
            column3.Categories = new List <object>()
            {
                "Ready to Serve"
            };
            column4.Categories = new List <object>()
            {
                "Door Delivery"
            };

            KanbanErrorBarSettings errorBar = new KanbanErrorBarSettings();

            errorBar.Height             = 2;
            errorBar.Color              = Color.FromRgb(179.0f / 255.0f, 71.0f / 255.0f, 36.0f / 255.0f);
            errorBar.MaxValidationColor = Color.FromRgb(211.0f / 255.0f, 51.0f / 255.0f, 54.0f / 255.0f);
            errorBar.MinValidationColor = Color.FromRgb(67.0f / 255.0f, 188.0f / 255.0f, 131.0f / 255.0f);

            column1.ErrorbarSettings = column2.ErrorbarSettings = column3.ErrorbarSettings
                                                                      = column4.ErrorbarSettings = errorBar;

            KanbanPlaceholderStyle style = new KanbanPlaceholderStyle();

            style.SelectedBackgroundColor = Color.FromRgb(250.0f / 255.0f, 199.0f / 255.0f, 173.0f / 255.0f);
            kanban.PlaceholderStyle       = style;

            List <KanbanWorkflow> flows = new List <KanbanWorkflow>();

            flows.Add(new KanbanWorkflow("Menu", new List <object>()
            {
                "Dining", "Delivery"
            }));
            flows.Add(new KanbanWorkflow("Dining", new List <object>()
            {
                "Ready to Serve"
            }));
            flows.Add(new KanbanWorkflow("Delivery", new List <object>()
            {
                "Door Delivery"
            }));
            flows.Add(new KanbanWorkflow("Ready to Serve", new List <object>()
            {
            }));
            flows.Add(new KanbanWorkflow("Door Delivery", new List <object>()
            {
            }));

            kanban.Workflows = flows;
        }