예제 #1
0
        public ShellNavBar(IMauiContext context) : base(context?.GetPlatformParent())
        {
            MauiContext = context;

            SetLayoutCallback(OnLayout);

            _menuButton          = new TButton(PlatformParent);
            _menuButton.Clicked += OnMenuClicked;
            _menuIcon            = new MaterialIcon(PlatformParent)
            {
                Color = _foregroundColor.ToCommon()
            };
            UpdateMenuIcon();

            _title = new TLabel(PlatformParent)
            {
                FontSize = this.GetDefaultTitleFontSize(),
                VerticalTextAlignment = (global::Tizen.UIExtensions.Common.TextAlignment)TextAlignment.Center,
                TextColor             = _titleColor.ToCommon(),
                FontAttributes        = Tizen.UIExtensions.Common.FontAttributes.Bold,
            };
            _title.Show();

            BackgroundColor             = _backgroudColor;
            _menuButton.BackgroundColor = _backgroudColor;
            PackEnd(_menuButton);
            PackEnd(_title);
        }
예제 #2
0
        public ShellNavBar(IMauiContext context) : base(context?.GetNativeParent())
        {
            MauiContext = context;

            _ = NativeParent ?? throw new ArgumentNullException(nameof(NativeParent));

            SetLayoutCallback(OnLayout);

            _menuButton          = new TButton(NativeParent);
            _menuButton.Clicked += OnMenuClicked;

            _menuIcon = new TImage(NativeParent);
            UpdateMenuIcon();

            _title = new TLabel(NativeParent)
            {
                FontSize = this.GetDefaultTitleFontSize(),
                VerticalTextAlignment = (global::Tizen.UIExtensions.Common.TextAlignment)TextAlignment.Center,
                TextColor             = _titleColor.ToCommon(),
                FontAttributes        = Tizen.UIExtensions.Common.FontAttributes.Bold,
            };
            _title.Show();

            BackgroundColor             = _backgroudColor;
            _menuButton.BackgroundColor = _backgroudColor;
            PackEnd(_menuButton);
            PackEnd(_title);
        }