Esempio n. 1
0
        public NewNotePage(NoteVM vm)
        {
            NavigationPage.SetHasBackButton(this, false);
            Title          = "Новая заметка";
            ViewModel      = vm;
            BindingContext = ViewModel;
            count_subtasks = 0;

            nameEntry = new CustomEditor2
            {
                Placeholder = "Введите название",
                TextColor   = Color.FromHex("0D47A1"),
                //PlaceholderColor = Color.DarkGray,
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Entry)),
                Margin   = new Thickness(0, 10, 0, 0),
            };
            nameEntry.SetBinding(Editor.TextProperty, "Name");
            nameEntry.TextChanged += NameEntry_TextChanged;

            //////комментарий
            commentEditor = new CustomEditor2
            {
                TextColor   = Color.FromHex("0D47A1"),
                Placeholder = "Добавьте комментарий",
            };
            commentEditor.TextChanged += Editor_TextChanged;
            commentEditor.SetBinding(CustomEditor2.TextProperty, "Comment");
            Grid commentGrid = new Grid
            {
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = GridLength.Auto
                    },
                    new ColumnDefinition {
                        Width = GridLength.Auto
                    },
                },
                Margin = new Thickness(0, 20, 0, 0)
            };

            commentGrid.Children.Add(new Label
            {
                Text                    = "//",
                WidthRequest            = 20,
                FontSize                = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                VerticalTextAlignment   = TextAlignment.Start,
                HorizontalTextAlignment = TextAlignment.Center
            }, 0, 0);
            commentGrid.Children.Add(commentEditor, 1, 0);

            /////////////////////подзадачи
            Label subtaskLabel = new Label
            {
                Text            = "Добавить подзадачу",
                VerticalOptions = LayoutOptions.Center,
                Margin          = new Thickness(2, 0, 0, 0)
            };
            StackLayout subdefaultSL = new StackLayout
            {
                Children =
                {
                    new Label
                    {
                        Text              = "➥",
                        FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                        HorizontalOptions = LayoutOptions.Center,
                        Margin            = new Thickness(3, 0, 0, 0)
                    },
                    subtaskLabel
                },
                Orientation = StackOrientation.Horizontal
            };

            subtasksSL = new StackLayout
            {
                Children = { subdefaultSL },
                Margin   = new Thickness(25, 11, 0, 0)
            };

            subtaskLabel.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(() =>
                {
                    count_subtasks++;

                    CustomButton donesubtaskButton = new CustomButton
                    {
                        FontSize          = Device.GetNamedSize(NamedSize.Micro, typeof(Button)),
                        WidthRequest      = 23,
                        HeightRequest     = 23,
                        BorderRadius      = 12,
                        BackgroundColor   = Color.White,
                        BorderWidth       = 1,
                        BorderColor       = Color.Gray,
                        HorizontalOptions = LayoutOptions.Center,
                        VerticalOptions   = LayoutOptions.Start,
                        Margin            = new Thickness(0, 3, 0, 0)
                    };
                    CustomEditor2 newsubtaskEditor = new CustomEditor2
                    {
                        Placeholder       = "Введите название",
                        TextColor         = Color.FromHex("0D47A1"),
                        FontSize          = Device.GetNamedSize(NamedSize.Small, typeof(Entry)),
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        WidthRequest      = 240
                    };
                    Label removesubtaskLabel = new Label
                    {
                        Text = "✖",
                        HorizontalTextAlignment = TextAlignment.Center,
                        VerticalTextAlignment   = TextAlignment.Center,
                        BackgroundColor         = Color.Transparent,
                        Margin            = new Thickness(-6, 2, 0, 0),
                        TextColor         = Color.Gray,
                        WidthRequest      = 35,
                        HorizontalOptions = LayoutOptions.Center,
                        VerticalOptions   = LayoutOptions.Start,
                    };
                    StackLayout newsubtaskSL = new StackLayout
                    {
                        Children    = { donesubtaskButton, newsubtaskEditor, removesubtaskLabel },
                        Orientation = StackOrientation.Horizontal
                    };
                    newsubtaskEditor.TextChanged += (sender, e) =>
                    {
                        var element = sender as CustomEditor2;
                        if (String.IsNullOrWhiteSpace(element.Text) == false)
                        {
                            element.Text = element.Text.Substring(0, 1).ToUpper() + element.Text.Remove(0, 1);
                        }
                        else
                        {
                            donesubtaskButton.Text = "";
                            element.Text           = element.Text.TrimStart();
                        }
                    };

                    if (subtasksSL.Children[0] == subdefaultSL)
                    {
                        subtasksSL.Children.Remove(subdefaultSL);
                    }
                    if (subtasksSL.Children.Count > 1)
                    {
                        subtasksSL.Children.Remove(subdefaultSL);
                    }

                    subtasksSL.Children.Add(newsubtaskSL);
                    subtasksSL.Children.Add(subdefaultSL);

                    donesubtaskButton.Clicked += (sender, e) =>
                    {
                        if (String.IsNullOrWhiteSpace(newsubtaskEditor.Text) == false)
                        {
                            if (Addition.IsStrikethrough(newsubtaskEditor.Text) == true)
                            {
                                donesubtaskButton.Text = "";
                                newsubtaskEditor.Text  = Addition.ConvertFromStrikethrough(newsubtaskEditor.Text);
                            }
                            else
                            {
                                donesubtaskButton.Text = "✔";
                                newsubtaskEditor.Text  = Addition.ConvertToStrikethrough(newsubtaskEditor.Text);
                            }
                        }
                    };
                    removesubtaskLabel.GestureRecognizers.Add(new TapGestureRecognizer
                    {
                        Command = new Command(() => { count_subtasks--; subtasksSL.Children.Remove(newsubtaskSL); })
                    });
                })
            });

            ////////////дата
            Image dateImage = new Image
            {
                Source        = "calendar.png",
                WidthRequest  = 17.5,
                HeightRequest = 17.5,
                Margin        = new Thickness(2, 0, 0, 0)
            };

            //datePicker = new CustomDatePicker
            //{
            //    Format = "Сегодня",
            //    FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(CustomDatePicker)),
            //    MinimumDate = DateTime.Today,
            //    WidthRequest = 165,
            //    HeightRequest = 35,
            //    HorizontalOptions=LayoutOptions.Start,
            //    Margin = new Thickness(1, 0, 0, 0)
            //};
            //datePicker.DateSelected += DatePicker_DateSelected;
            //datePicker.SetBinding(CustomDatePicker.DateProperty, "Date");
            datePicker = new CustomDatePicker
            {
                Format            = "Сегодня",
                FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(CustomDatePicker)),
                MinimumDate       = DateTime.Today,
                WidthRequest      = 165,
                HeightRequest     = 35,
                HorizontalOptions = LayoutOptions.Start,
                Margin            = new Thickness(1, 0, 0, 0)
            };
            datePicker.DateSelected += DatePicker_DateSelected;
            datePicker.SetBinding(CustomDatePicker.DateProperty, "Date");

            StackLayout dateStackLayout = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Margin      = new Thickness(0, 11, 0, 0),
                Children    = { dateImage, datePicker }
            };

            ///////////////
            //Label markerlabel = new Label
            //{
            //    Margin = new Thickness(0, 11, 0, 0),
            //    Text = "Пометить?",
            //    FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
            //};
            Button colorButton0 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("ffffff"), Text = "✔"
            }; colorButton0.Clicked += ColorButton_Clicked;

            lastButton_int = colorButton0.GetHashCode();
            Button colorButton1 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("ff897d")
            }; colorButton1.Clicked += ColorButton_Clicked;
            Button colorButton2 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("ffd27a")
            }; colorButton2.Clicked += ColorButton_Clicked;
            Button colorButton3 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("cbff8a")
            }; colorButton3.Clicked += ColorButton_Clicked;
            Button colorButton4 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("80afff")
            }; colorButton4.Clicked += ColorButton_Clicked;
            Button colorButton5 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("b484ff")
            }; colorButton5.Clicked += ColorButton_Clicked;
            Button colorButton6 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("f9bad0")
            }; colorButton6.Clicked += ColorButton_Clicked;
            Button colorButton7 = new Button {
                Style = Addition.buttonStyle2, BackgroundColor = Color.FromHex("cfd8dc")
            }; colorButton7.Clicked += ColorButton_Clicked;

            chooseColorSL = new StackLayout
            {
                Children          = { colorButton0, colorButton1, colorButton2, colorButton3, colorButton4, colorButton5, colorButton6, colorButton7 },
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Margin            = new Thickness(0, 20, 0, 0),
            };

            ///////////////////////////////////////////
            Label repeatlabel = new Label
            {
                Text = "Каждый день",
                //Margin = new Thickness(0, 3, 0, 0),
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                //HorizontalOptions = LayoutOptions.End
            };

            repeatSwitch = new Switch(); /*{ HorizontalOptions=LayoutOptions.EndAndExpand};*/
            repeatSwitch.SetBinding(Switch.IsToggledProperty, "Repeat");
            //repeatSwitch.Toggled += RepeatSwitch_Toggled;
            StackLayout repeatSL = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Margin      = new Thickness(0, 11, 0, 0),
                Children    = { repeatlabel, repeatSwitch }
            };

            mondayButton = new Button {
                Text = "П", Style = Addition.buttonStyle
            }; mondayButton.Clicked += Button_Clicked;
            tuesdayButton = new Button {
                Text = "В", Style = Addition.buttonStyle
            }; tuesdayButton.Clicked += Button_Clicked;
            wednesdayButton = new Button {
                Text = "С", Style = Addition.buttonStyle
            }; wednesdayButton.Clicked += Button_Clicked;
            thursdayButton = new Button {
                Text = "Ч", Style = Addition.buttonStyle
            }; thursdayButton.Clicked += Button_Clicked;
            fridayButton = new Button {
                Text = "П", Style = Addition.buttonStyle
            }; fridayButton.Clicked += Button_Clicked;
            saturdayButton = new Button {
                Text = "С", Style = Addition.buttonStyle
            }; saturdayButton.Clicked += Button_Clicked;
            sundayButton = new Button {
                Text = "В", Style = Addition.buttonStyle
            }; sundayButton.Clicked += Button_Clicked;

            choosedaysSL = new StackLayout
            {
                Children          = { mondayButton, tuesdayButton, wednesdayButton, thursdayButton, fridayButton, saturdayButton, sundayButton },
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Margin            = new Thickness(0, 5, 0, 0),
            };
            choosedaysSL.SetBinding(IsVisibleProperty, "Repeat");

            /////////////////////////////////
            addButton = new Button
            {
                Text            = "✔",
                BackgroundColor = Color.White,
                TextColor       = Color.Gray,
                IsEnabled       = false
            };
            addButton.Pressed += AddButton_Clicked;
            //addButton.Clicked += AddButton_Clicked;

            Button backButton = new Button
            {
                Text            = "➥",
                BackgroundColor = Color.White,
                TextColor       = Color.FromHex("0D47A1")
            };

            backButton.SetBinding(Button.CommandProperty, "ListViewModel.BackCommand");
            //backButton.Clicked += RemoveSelectedItem;

            StackLayout buttonsStackLayout = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.EndAndExpand,
                Children          = { addButton, backButton }
            };

            //Label0 = new Label { Text = "switch:" + ViewModel.Repeat };
            //Label1 = new Label { Text = "Пон:" + ViewModel.everyMonday };
            //Label2 = new Label { Text = "Вт:" + ViewModel.everyTuesday };
            //Label3 = new Label { Text = "Ср:" + ViewModel.everyWednesday };
            //Label4 = new Label { Text = "Чет:" + ViewModel.everyThursday };
            //Label5 = new Label { Text = "Пят:" + ViewModel.everyFriday };
            //Label6 = new Label { Text = "Суб:" + ViewModel.everySaturday };
            //Label7 = new Label { Text = "Воскр:" + ViewModel.everySunday };

            Label0 = new Label();
            Label1 = new Label();
            Button button = new Button {
                Text = "check"
            };

            button.Clicked += (sender, e) =>
            {
                string str   = null;
                int    count = 0;
                for (int i = 0; i <= count_subtasks - 1; i++)
                {
                    if (String.IsNullOrEmpty(((subtasksSL.Children[i] as StackLayout).Children[1] as CustomEditor2).Text) == false)
                    {
                        str += ((subtasksSL.Children[i] as StackLayout).Children[1] as CustomEditor2).Text + "✖";
                        count++;
                    }
                }
                Label0.Text = str;
                Label1.Text = count.ToString();
            };

            ScrollView scrollView = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        nameEntry,
                        commentGrid,
                        subtasksSL,
                        dateStackLayout,
                        repeatSL, /*choosedaysSL,*/
                        /*markerlabel,*/ chooseColorSL,
                        //Label0,
                        //Label1,
                        //button,
                        //Label2,Label3,Label4,Label5,Label6,Label7,
                        buttonsStackLayout
                    },

                    BackgroundColor = Color.White,
                    Padding         = new Thickness(15)
                }
            };

            Content = scrollView;
        }
Esempio n. 2
0
        public allNotesPage()
        {
            Title = "Список дел";
            ToolbarItem toolbar_edit2 = new ToolbarItem {
                Icon = "toolbar_edit3.png"
            };

            toolbar_edit2.Clicked += Toolbar_edit2_Clicked;
            ToolbarItems.Add(ToolbarItem);
            ToolbarItems.Add(toolbar_edit2);
            BindingContext = new NotesViewModel()
            {
                Navigation = this.Navigation
            };

            notesListView = new CustomListView
            {
                //Margin = new Thickness(15,0,15,0),
                HasUnevenRows       = true,
                IsGroupingEnabled   = true,
                GroupHeaderTemplate = new DataTemplate(() =>
                {
                    Label headerLabel = new Label
                    {
                        TextColor      = Color.FromHex("0D47A1"),
                        FontAttributes = FontAttributes.None,
                        Margin         = new Thickness(25, 20, 0, 15)
                    };
                    headerLabel.SetBinding(Label.TextProperty, "Name");
                    return(new ViewCell
                    {
                        View = headerLabel
                    });
                }),
                ItemTemplate = new DataTemplate(() =>
                {
                    Label nameLabel = new Label
                    {
                        FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                        Margin   = new Thickness(5, 0, 0, 0)
                    };
                    nameLabel.SetBinding(Label.TextProperty, "Name");

                    Label commentLabel = new Label();
                    commentLabel.SetBinding(Label.TextProperty, "Comment");
                    commentLabel.SetBinding(Label.IsVisibleProperty, "HasComment");

                    Label sublabel = new Label {
                        IsVisible = false
                    };
                    sublabel.SetBinding(Label.TextProperty, "Subtasks_string", BindingMode.TwoWay);

                    int count_subtasks     = 0;
                    StackLayout subtasksSL = new StackLayout
                    {
                        Margin  = new Thickness(35, 0, 0, 0),
                        Spacing = 10
                    };
                    subtasksSL.SetBinding(StackLayout.IsVisibleProperty, "HasSubtasks");

                    sublabel.BindingContextChanged += (sender, e) =>
                    {
                        string str = sublabel.Text;
                        if (str != null)
                        {
                            string[] subtasks_array = str.Split(new char[] { '✖' });
                            foreach (char s in str)
                            {
                                if (s == '✖')
                                {
                                    count_subtasks++;
                                }
                            }

                            for (int i = 1; i <= count_subtasks; i++)
                            {
                                int subtask_index = i - 1;
                                CustomButton donesubtaskButton = new CustomButton
                                {
                                    FontSize          = Device.GetNamedSize(NamedSize.Micro, typeof(Button)),
                                    WidthRequest      = 23,
                                    HeightRequest     = 23,
                                    BorderRadius      = 12,
                                    BackgroundColor   = Color.Transparent,
                                    BorderWidth       = 1,
                                    BorderColor       = Color.LightGray,
                                    HorizontalOptions = LayoutOptions.Center,
                                    VerticalOptions   = LayoutOptions.Start
                                };
                                donesubtaskButton.SetBinding(Button.TextColorProperty, "TextColorSubtasks");
                                donesubtaskButton.SetBinding(Button.BorderColorProperty, "ColorSubtasks");

                                Label newsubtaskLabel = new Label
                                {
                                    FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Entry)),
                                    Text     = subtasks_array[i - 1]
                                };

                                if (Addition.IsStrikethrough(newsubtaskLabel.Text) == true)
                                {
                                    donesubtaskButton.Text = "✔";
                                }

                                StackLayout newsubtaskSL = new StackLayout
                                {
                                    Children    = { donesubtaskButton, newsubtaskLabel },
                                    Orientation = StackOrientation.Horizontal
                                };
                                subtasksSL.Children.Add(newsubtaskSL);

                                donesubtaskButton.Clicked += async(sender2, e2) =>
                                {
                                    string substringOld = newsubtaskLabel.Text;
                                    if (Addition.IsStrikethrough(newsubtaskLabel.Text) == true)
                                    {
                                        donesubtaskButton.Text = "";
                                        newsubtaskLabel.Text   = Addition.ConvertFromStrikethrough(newsubtaskLabel.Text);
                                    }
                                    else
                                    {
                                        donesubtaskButton.Text = "✔";
                                        newsubtaskLabel.Text   = Addition.ConvertToStrikethrough(newsubtaskLabel.Text);
                                    }

                                    subtasks_array[subtask_index] = newsubtaskLabel.Text;
                                    str           = String.Join("✖", subtasks_array);
                                    sublabel.Text = str;

                                    var note = sublabel?.BindingContext as NoteVM;
                                    await App.Database.SaveItemAsync(note);
                                    //var vm = BindingContext as NotesViewModel;
                                    //vm?.UpdateSubTasks(note);

                                    //Navigation.PopAsync();
                                    //Navigation.PopToRootAsync();

                                    //OnPropertyChanged2(sublabel.Text);
                                };
                            }
                        }
                    };

                    Label everydayLabel = new Label
                    {
                        Text     = "Каждый день",
                        FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label))
                    };
                    everydayLabel.SetBinding(Label.IsVisibleProperty, "Repeat");

                    Label overdueLabel = new Label {
                        FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label))
                    };
                    overdueLabel.SetBinding(Label.TextProperty, "Overdue_str");
                    overdueLabel.SetBinding(Label.IsVisibleProperty, "IsOverdue");

                    CustomButton doneButton = new CustomButton
                    {
                        FontSize          = Device.GetNamedSize(NamedSize.Micro, typeof(Button)),
                        WidthRequest      = 30,
                        HeightRequest     = 30,
                        BorderRadius      = 15,
                        BorderColor       = Color.LightGray,
                        BorderWidth       = 1,
                        HorizontalOptions = LayoutOptions.Center,
                        VerticalOptions   = LayoutOptions.Start,
                        Margin            = new Thickness(0, 1, 0, 0)
                    };
                    doneButton.SetBinding(Button.BorderWidthProperty, "ButtonsWidth");
                    doneButton.SetBinding(BackgroundColorProperty, "ColorMarker");
                    doneButton.Clicked += Done_Clicked;
                    doneButton.Clicked += (sender, e) =>
                    {
                        nameLabel.Text = Addition.ConvertToStrikethrough(nameLabel.Text);
                    };

                    Button removeButton = new Button
                    {
                        Text            = "✖",
                        BackgroundColor = Color.White,
                        TextColor       = Color.FromHex("0D47A1")
                    };
                    removeButton.Clicked += RemoveButton_Clicked;

                    Button editButton = new Button
                    {
                        Text            = "•••",
                        FontAttributes  = FontAttributes.Bold,
                        BackgroundColor = Color.White,
                        TextColor       = Color.FromHex("0D47A1")
                    };
                    editButton.Clicked += edit_Clicked;

                    StackLayout invisibleStackL = new StackLayout
                    {
                        Orientation       = StackOrientation.Horizontal,
                        HorizontalOptions = LayoutOptions.Center,
                        Margin            = new Thickness(0, 10, 0, 0),
                        Padding           = new Thickness(-20, 0, 0, 0),
                        Children          = { removeButton, editButton }
                    };
                    invisibleStackL.SetBinding(StackLayout.IsVisibleProperty, "IsVisible");

                    return(new ViewCell
                    {
                        View = new StackLayout
                        {
                            Orientation = StackOrientation.Vertical,
                            Children =
                            {
                                new StackLayout
                                {
                                    Orientation = StackOrientation.Horizontal,
                                    Children =
                                    {
                                        doneButton,
                                        new StackLayout
                                        {
                                            Children =
                                            {
                                                nameLabel,
                                                new StackLayout
                                                {
                                                    Orientation = StackOrientation.Horizontal,
                                                    Children ={ everydayLabel, overdueLabel                },
                                                    Margin = new Thickness(5,                 0, 0, 0)
                                                },
                                            },
                                        }
                                    }
                                },
                                commentLabel,
                                sublabel,
                                subtasksSL,
                                invisibleStackL
                            },
                            Margin = new Thickness(10),
                            Padding = new Thickness(20, 0, 10, 0),
                            Spacing = 15,
                        }
                    });
                    //Label nameLabel = new Label { FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) };
                    //nameLabel.SetBinding(Label.TextProperty, "Name");

                    //Label everydayLabel = new Label
                    //{
                    //    Text = "Каждый день",
                    //    FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label))
                    //};
                    //everydayLabel.SetBinding(Label.IsVisibleProperty, "Repeat");

                    //Label overdueLabel = new Label { FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)) };
                    //overdueLabel.SetBinding(Label.TextProperty, "Overdue_str");
                    //overdueLabel.SetBinding(Label.IsVisibleProperty, "IsOverdue");

                    //Button doneButton = new Button
                    //{
                    //    Text = "✔",
                    //    BackgroundColor = Color.White,
                    //    TextColor = Color.FromHex("0D47A1")
                    //};
                    //doneButton.Clicked += Done_Clicked;

                    //Button removeButton = new Button
                    //{
                    //    Text = "✖",
                    //    BackgroundColor = Color.White,
                    //    TextColor = Color.FromHex("0D47A1")
                    //};
                    //removeButton.Clicked += RemoveButton_Clicked;

                    //Button editButton = new Button
                    //{
                    //    Text = "•••",
                    //    FontAttributes = FontAttributes.Bold,
                    //    BackgroundColor = Color.White,
                    //    TextColor = Color.FromHex("0D47A1")
                    //};
                    //editButton.Clicked += edit_Clicked;

                    //StackLayout invisibleStackL = new StackLayout
                    //{
                    //    Orientation = StackOrientation.Horizontal,
                    //    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    //    Margin = new Thickness(0, 10, 0, 0),
                    //    Children = { doneButton,removeButton, editButton }
                    //};
                    //invisibleStackL.SetBinding(StackLayout.IsVisibleProperty, "IsVisible");

                    //Grid grid = new Grid
                    //{
                    //    ColumnDefinitions =
                    //    {
                    //        new ColumnDefinition { Width = new GridLength(0.95, GridUnitType.Star)},
                    //        new ColumnDefinition { Width = new GridLength(0.05, GridUnitType.Star)}
                    //    },
                    //    ColumnSpacing = 0
                    //};

                    //BoxView boxView = new BoxView();
                    //boxView.SetBinding(BackgroundColorProperty, "ColorMarker");


                    //grid.Children.Add(new StackLayout
                    //{
                    //    Orientation = StackOrientation.Vertical,
                    //    Children = { nameLabel,
                    //            new StackLayout
                    //            {   Orientation = StackOrientation.Horizontal,
                    //                Children ={everydayLabel,overdueLabel}},
                    //    invisibleStackL },
                    //    Margin = new Thickness(10),
                    //    Padding = new Thickness(35, 0, 0, 0),
                    //    Spacing = 15,
                    //}, 0, 0);
                    //grid.Children.Add(boxView, 1, 0);

                    //return new ViewCell
                    //{
                    //    View = grid
                    //};
                })
            };
            notesListView.ItemTapped += NotesListView_ItemTapped;

            addButton = new Button
            {
                Text              = "+",
                FontSize          = Device.GetNamedSize(NamedSize.Large, typeof(Button)),
                BackgroundColor   = Color.FromHex("E3F2FD"),
                TextColor         = Color.FromHex("0D47A1"),
                HorizontalOptions = LayoutOptions.End,
                VerticalOptions   = LayoutOptions.End,
                WidthRequest      = 70,
                HeightRequest     = 70,
                BorderRadius      = 35,
                Margin            = new Thickness(0, 0, 20, 20)
            };
            addButton.SetBinding(Button.CommandProperty, "CreateNoteCommand");
            pastactionLabel = new Label
            {
                Text = "Отменить",
                //IsVisible = false,
                //IsVisible = true,
                //IsVisible = App.pastaction,
                //TextColor =Color.Red,
                TextColor         = Color.FromHex("0D47A1"),
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };
            pastactionLabel.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(() => pastactionLabel.Text = "Кликнул"),
            });

            RelativeLayout relativeLayout = new RelativeLayout();

            relativeLayout.Children.Add(notesListView,
                                        Constraint.RelativeToParent((parent) => parent.X),
                                        Constraint.RelativeToParent((parent) => parent.Y /*+ 20*/),
                                        //Constraint.RelativeToView(pastactionLabel, (parent,view)=>/*parent.Y+*/pastactionLabel.Height),
                                        Constraint.RelativeToParent((parent) => parent.Width),
                                        Constraint.RelativeToParent((parent) => parent.Height /** .975*/));

            //double pastactionLabelWidth(RelativeLayout parent) => pastactionLabel.Measure(parent.Width, parent.Height).Request.Width;
            ////double pastactionLabelHeight(RelativeLayout parent) => pastactionLabel.Measure(parent.Width, parent.Height).Request.Height;
            //relativeLayout.Children.Add(pastactionLabel,
            //    //Constraint.RelativeToParent(parent => parent.Width / 2 - pastactionLabelWidth(parent) / 2),
            //    //Constraint.RelativeToParent(parent => notesListView.Width)
            //    Constraint.RelativeToView(notesListView, (parent, view) => notesListView.Width - pastactionLabelWidth(parent)),
            //    Constraint.RelativeToParent(parent => parent.Y+5)
            //    );

            //double getnonotesLabelWidth(RelativeLayout parent) => nonotesLabel.Measure(parent.Width, parent.Height).Request.Width;
            //relativeLayout.Children.Add(nonotesLabel,
            //    Constraint.RelativeToParent(parent => parent.Width / 2 - getnonotesLabelWidth(parent) / 2),
            //    Constraint.RelativeToParent(parent => parent.Height*.45));
            double getnonotesImageWidth(RelativeLayout parent) => nonotesImage.Measure(parent.Width, parent.Height).Request.Width;
            double getnonotesImageHeight(RelativeLayout parent) => nonotesImage.Measure(parent.Width, parent.Height).Request.Width;

            relativeLayout.Children.Add(nonotesImage,
                                        Constraint.RelativeToParent(parent => /*parent.Width/2- 100*/ parent.Width / 2 - getnonotesImageWidth(parent) / 2),
                                        Constraint.RelativeToParent(parent => parent.Height / 2 - getnonotesImageHeight(parent) / 2 /*parent.Height/2-100*/ /*parent.Height * .45*/));

            relativeLayout.Children.Add(addButton,
                                        Constraint.RelativeToParent((parent) => parent.Width * .75),
                                        Constraint.RelativeToParent((parent) => parent.Height * .8125));

            this.BackgroundColor = Color.White;
            this.Content         = relativeLayout;
        }