Exemple #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="MainTabBarView"/> class.
        /// </summary>
        public MainTabBarView()
        {
            this.logService = DependencyService.Resolve <ILogService>();
            // Set default values here.
            OnPlatform <string> fontFamily = (OnPlatform <string>)Application.Current.Resources["FontAwesomeSolid"];

            this.Button1FontFamily = fontFamily;
            this.Button2FontFamily = fontFamily;
            this.Button3FontFamily = fontFamily;

            InitializeComponent();

            Button1.SetBinding(Button.CommandProperty, new Binding(nameof(Button1Command), source: this));
            Button2.SetBinding(Button.CommandProperty, new Binding(nameof(Button2Command), source: this));
            Button3.SetBinding(Button.CommandProperty, new Binding(nameof(Button3Command), source: this));

            Button1.SetBinding(Button.FontFamilyProperty, new Binding(nameof(Button1FontFamily), source: this));
            Button2.SetBinding(Button.FontFamilyProperty, new Binding(nameof(Button2FontFamily), source: this));
            Button3.SetBinding(Button.FontFamilyProperty, new Binding(nameof(Button3FontFamily), source: this));

            Button1.SetBinding(Button.TextProperty, new Binding(nameof(Button1Text), source: this));
            Button2.SetBinding(Button.TextProperty, new Binding(nameof(Button2Text), source: this));
            Button3.SetBinding(Button.TextProperty, new Binding(nameof(Button3Text), source: this));
        }