Skip to content

This is an DependencyService to add a middle title to android pro of Xamarin.Forms

Notifications You must be signed in to change notification settings

Peefy/Xamarin.Forms.AndroidToolBarMiddleText

Repository files navigation

AndroidToolBarMiddleText

This is an DependencyService to add a middle title to android pro of Xamarin.Forms

预览

Screenshots Screenshots

Xamarin.AndroidToolBarMiddleText

  • XAML样例
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="AndroidToolBarMiddleText.MainPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:binders="clr-namespace:DuGu.XFLib.Binders"
    xmlns:local="clr-namespace:AndroidToolBarMiddleText"
    xmlns:viewmodels="clr-namespace:AndroidToolBarMiddleText.ViewModels"
    binders:AndroidToolBarBinder.MiddleText="{Binding Title}">
    <ContentPage.BindingContext>
        <viewmodels:MainViewModel Title="MainPage" />
    </ContentPage.BindingContext>
    <Button
        Command="{Binding GoToSecondPageCommand}"
        HorizontalOptions="Center"
        Text="Go To Second Page"
        VerticalOptions="Center" />
</ContentPage>
  • Code样例
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

using DuGu.XFLib.Binders;
using AndroidToolBarMiddleText.ViewModels;

namespace AndroidToolBarMiddleText
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class SecondPage : ContentPage
    {
        public SecondPage()
        {
            InitializeComponent();
            this.BindingContext = new SecondViewModel();
            AndroidToolBarBinder.SetMiddleText(this, "Second Page");
        }
    }
}

About

This is an DependencyService to add a middle title to android pro of Xamarin.Forms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages