예제 #1
0
 public BarBackgroundPage()
 {
     InitializeComponent();
     Title = "Monkey Title";
     opacitySlider.Value = 0.6f;
     CustomNavigationPage.SetTitleColor(this, Color.Navy);
     CustomNavigationPage.SetBarBackground(this, Device.RuntimePlatform == Device.iOS ? "monkeybackground.jpg" : "monkeybackground");
 }
예제 #2
0
 private void ColorPicker_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (startColorPicker.SelectedIndex != -1 && endColorPicker.SelectedIndex != -1)
     {
         var startColor = App.Colors.FirstOrDefault(n => n.Item1 == startColorPicker.Items[startColorPicker.SelectedIndex]).Item2;
         var endColor   = App.Colors.FirstOrDefault(n => n.Item1 == endColorPicker.Items[endColorPicker.SelectedIndex]).Item2;
         CustomNavigationPage.SetGradientColors(this, new Tuple <Color, Color>(startColor, endColor));
     }
 }
 public MainPage()
 {
     CustomNavigationPage.SetTitleMargin(this, new Thickness(0, 0, 5, 0));
     CustomNavigationPage.SetTitleColor(this, Color.Gray);
     CustomNavigationPage.SetSubtitleColor(this, Color.ForestGreen);
     CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.End);
     CustomNavigationPage.SetSubtitleFont(this, Font.SystemFontOfSize(NamedSize.Micro));
     InitializeComponent();
     listView.ItemsSource = options;
 }
예제 #4
0
        private void TitleColorPicker_SelectedIndexChanged(object sender, EventArgs e)
        {
            var picker        = (Picker)sender;
            int selectedIndex = picker.SelectedIndex;

            if (selectedIndex != -1)
            {
                var titleColor = App.Colors.FirstOrDefault(n => n.Item1 == picker.Items[selectedIndex]).Item2;
                CustomNavigationPage.SetTitleColor(this, titleColor);
            }
        }
        public FormattedTitlePage()
        {
            this.FormattedTitle = new FormattedString();
            this.FormattedTitle.Spans.Add(new Span()
            {
                Text            = "My ",
                FontSize        = 14,
                ForegroundColor = Color.Orange,
            });

            this.FormattedTitle.Spans.Add(new Span()
            {
                Text            = "Awesome ",
                FontSize        = 18,
                ForegroundColor = Color.Navy,
            });

            this.FormattedTitle.Spans.Add(new Span()
            {
                Text            = "Title",
                FontSize        = 16,
                ForegroundColor = Color.LightGreen,
            });

            this.FormattedSubtitle = new FormattedString();
            this.FormattedSubtitle.Spans.Add(new Span()
            {
                Text            = "Just ",
                FontSize        = 10,
                ForegroundColor = Color.Brown,
            });

            this.FormattedSubtitle.Spans.Add(new Span()
            {
                Text            = "a nice ",
                FontSize        = 14,
                ForegroundColor = Color.DarkSalmon,
            });

            this.FormattedSubtitle.Spans.Add(new Span()
            {
                Text            = "Subtitle",
                FontSize        = 12,
                ForegroundColor = Color.Purple,
            });
            CustomNavigationPage.SetTitlePosition(this, TitleAlignment.Center);

            InitializeComponent();
        }
예제 #6
0
        public GradientTitlePage()
        {
            Title = "My Title";
            CustomNavigationPage.SetTitleMargin(this, new Thickness(5, 5, 5, 5));
            InitializeComponent();

            startColorPicker.ItemsSource = App.Colors;
            endColorPicker.ItemsSource   = App.Colors;
            titleColorPicker.ItemsSource = App.Colors;

            titleColorPicker.SelectedIndex        = App.Colors.Count - 2;
            startColorPicker.SelectedIndex        = 1;
            endColorPicker.SelectedIndex          = App.Colors.Count - 1;
            gradientDirectionPicker.SelectedIndex = 0;
        }
        public TitleBorderPage()
        {
            Title = "Bordered Title";


            InitializeComponent();
            titleEntry.Text = Title;
            titleBorderColorPicker.ItemsSource = App.Colors;
            titleFillColorPicker.ItemsSource   = App.Colors;

            titleBorderColorPicker.SelectedIndex = 5;

            titleFillColorPicker.SelectedIndex = 10;
            CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
        }
        private void PositionPickerSelectedIndexChanged(object sender, EventArgs e)
        {
            var picker        = (Picker)sender;
            int selectedIndex = picker.SelectedIndex;

            if (selectedIndex != -1)
            {
                switch (picker.Items[selectedIndex])
                {
                case "Start":
                    CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Start);
                    break;

                case "Center":
                    CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
                    break;

                case "End":
                    CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.End);
                    break;
                }
            }
        }
예제 #9
0
 public TitleImagePage()
 {
     CustomNavigationPage.SetTitleBackground(this, "icon");
     CustomNavigationPage.SetTitlePosition(this, CustomNavigationPage.TitleAlignment.Center);
     InitializeComponent();
 }
예제 #10
0
        public App()
        {
            InitializeComponent();

            MainPage = new CustomNavigationPage(new CustomNavigationBarSample.MainPage());
        }
예제 #11
0
 private void OpacitySlider_ValueChanged(object sender, ValueChangedEventArgs e)
 {
     CustomNavigationPage.SetBarBackgroundOpacity(this, (float)e.NewValue);
 }
 private void TitleMarginSlider_ValueChanged(object sender, ValueChangedEventArgs e)
 {
     CustomNavigationPage.SetTitleMargin(this, new Thickness((float)e.NewValue, (float)e.NewValue, (float)e.NewValue, (float)e.NewValue));
 }
 private void BorderWidthSlider_ValueChanged(object sender, ValueChangedEventArgs e)
 {
     CustomNavigationPage.SetTitleBorderWidth(this, (float)e.NewValue);
 }
 private void Switch_Toggled(object sender, ToggledEventArgs e)
 {
     CustomNavigationPage.SetHasShadow(this, e.Value);
 }