Ejemplo n.º 1
0
        private StackLayout addNewItem(string fee_name, string fee_value, string calculate_type)
        {
            var stack_new_item = new StackLayout()
            {
                Padding           = new Thickness(20, 10),
                HorizontalOptions = LayoutOptions.Center
            };
            var grid      = new Grid();
            var frame_lay = new Frame()
            {
                BorderColor = Color.FromHex("#F8F8F8"), BackgroundColor = Color.White, Padding = new Thickness(5)
            };

            var stack         = new StackLayout();
            var lbl_item_name = new Label()
            {
                FontSize          = 10,
                TextColor         = Color.FromHex("#A0A0A0"),
                HorizontalOptions = LayoutOptions.StartAndExpand,
                Text = fee_name
            };
            var editor_new_item = new BorderlessEditor()
            {
                HorizontalOptions = LayoutOptions.Fill,
                TextColor         = getColor(calculate_type),
                MaxLength         = 10,
                AutoSize          = EditorAutoSizeOption.TextChanges,
                Keyboard          = Keyboard.Numeric,
                FlowDirection     = FlowDirection.RightToLeft,
                Text = fee_value
            };

            stack.Children.Add(lbl_item_name);
            stack.Children.Add(editor_new_item);
            frame_lay.Content = stack;

            var lbl_unit = new Label()
            {
                Text              = "円",
                TextColor         = Color.Black,
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.End
            };

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(9, GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            grid.Children.Add(frame_lay, 0, 0);
            grid.Children.Add(lbl_unit, 1, 0);

            stack_new_item.Children.Add(grid);
            return(stack_new_item);
        }
Ejemplo n.º 2
0
        public Editor()
        {
            _editor = new BorderlessEditor
            {
                BackgroundColor = XColor.Transparent,
                VerticalOptions = LayoutOptions.Start
            };

            Content = _editor;
        }