Ejemplo n.º 1
0
 void UpdateActionButtonIcon(ImageSource source)
 {
     if (source is FileImageSource filesource)
     {
         var path        = ResourcePath.GetPath(filesource);
         var buttonImage = new ElmSharp.Image(_actionButton);
         buttonImage.Load(path);
         buttonImage.Show();
         _actionButton.SetPartContent("elm.swallow.content", buttonImage);
     }
     else
     {
         _actionButton.SetPartContent("elm.swallow.content", null);
     }
 }
Ejemplo n.º 2
0
        public ShellNavBar(IFlyoutController flyoutController) : base(System.Maui.Maui.NativeParent)
        {
            _flyoutController = flyoutController;

            _menuButton          = new EButton(System.Maui.Maui.NativeParent);
            _menuButton.Clicked += OnMenuClicked;
            _menu = new EImage(System.Maui.Maui.NativeParent);
            UpdateMenuIcon();
            _menu.Show();
            _menuButton.Show();

            _menuButton.SetPartContent("icon", _menu);

            _title = new Native.Label(System.Maui.Maui.NativeParent)
            {
                FontSize = Device.Idiom == TargetIdiom.TV ? 60 : 23,
                VerticalTextAlignment = Native.TextAlignment.Center,
                TextColor             = _backgroudColor,
                FontAttributes        = FontAttributes.Bold,
            };
            _title.Show();

            BackgroundColor             = _backgroudColor;
            _menuButton.BackgroundColor = _backgroudColor;
            PackEnd(_menuButton);
            PackEnd(_title);
            LayoutUpdated += OnLayoutUpdated;
        }
Ejemplo n.º 3
0
 public static bool SetIconPart(this EButton button, EvasObject content, bool preserveOldContent = false)
 {
     return(button.SetPartContent(ThemeConstants.Button.Parts.Icon, content, preserveOldContent));
 }