Beispiel #1
0
 /// <summary>
 ///     Constructor for the main page.
 /// </summary>
 public MainPage()
 {
     InitializeComponent();
     // Expressing to the ListView on what kind of cell type it will be using
     // NotesListView.ItemTemplate = new DataTemplate(typeof(NoteCell));
     // Attaching the source
     Mainpage      = this;
     MainSearchBar = CustomSearchBar;
 }
        public NavigationBarViewModel(ListView lView, List <ItemsListView> ListItems, MasterView master)
        {
            this.lView     = lView;
            this.ListItems = ListItems;
            this.master    = master;

            gridMenu          = new Grid();
            labelTitle        = new Label();
            sBar              = new CustomSearchBar();
            volverAtrasSearch = new Button();
            frame             = new Frame();

            frame.Content         = gridMenu;
            frame.BackgroundColor = Color.Transparent;
            frame.CornerRadius    = 0;
            frame.Margin          = 0;
            frame.BorderColor     = Color.Transparent;
            frame.Padding         = 0;
            frame.HasShadow       = true;

            gridMenu.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(0.18, GridUnitType.Star)
            });
            gridMenu.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(0.66, GridUnitType.Star)
            });
            gridMenu.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(0.18, GridUnitType.Star)
            });
            gridMenu.RowDefinitions.Add(new RowDefinition {
                Height = 56
            });
            gridMenu.Margin = 0;

            // Propiedades searchBar
            sBar.IsVisible         = false;
            sBar.Placeholder       = "Search in TeeChart";
            sBar.TextChanged      += sBar_TextChanged;
            sBar.TextColor         = Color.FromRgb(80, 80, 80);
            sBar.PlaceholderColor  = Color.FromRgb(90, 90, 90);
            sBar.WidthRequest      = 500;
            sBar.BackgroundColor   = Color.Transparent;
            sBar.CancelButtonColor = Color.FromRgb(110, 110, 110);
            sBar.HorizontalOptions = LayoutOptions.FillAndExpand;
            sBar.VerticalOptions   = LayoutOptions.FillAndExpand;
            sBar.FontSize          = 15.5;
            gridMenu.Children.Add(sBar, 1, 0);

            // Button "volverAtrasSearch"
            volverAtrasSearch                   = new Button();
            volverAtrasSearch.ImageSource       = "ic_arrow_back_black_24dp.png";
            volverAtrasSearch.Clicked          += AtrasSearch_Clicked;
            volverAtrasSearch.BackgroundColor   = Color.Transparent;
            volverAtrasSearch.VerticalOptions   = LayoutOptions.Center;
            volverAtrasSearch.HorizontalOptions = LayoutOptions.Center;
            volverAtrasSearch.IsVisible         = false;
            volverAtrasSearch.CornerRadius      = 90;
            volverAtrasSearch.WidthRequest      = 35;
            volverAtrasSearch.HeightRequest     = 35;

            volverAtrasSearch.Pressed  += volverAtrasSearch_Pressed;
            volverAtrasSearch.Released += volverAtrasSearch_Released;

            gridMenu.Children.Add(volverAtrasSearch, 0, 0);

            gridMenu.Children.Add(labelTitle, 1, 0);

            InicialitzarBar();
            AñadirMasterMenuButton();
            AñadirSearchButton();
            this.Children.Add(frame);
            labelTitle.Text                    = "TeeChart DEMO";
            labelTitle.FontSize                = 16.5;
            labelTitle.FontAttributes          = FontAttributes.Bold;
            labelTitle.TextColor               = Color.White;
            labelTitle.VerticalOptions         = LayoutOptions.Center;
            labelTitle.HorizontalTextAlignment = TextAlignment.Start;
            labelTitle.Margin                  = new Thickness(9, 0, 0, 0);
            labelTitle.VerticalTextAlignment   = TextAlignment.Center;
        }