Beispiel #1
0
        void InitializeTabsItem(EToolbarItem item, string resource)
        {
            //The source of icon resources is https://materialdesignicons.com/
            ImageSource src = ImageSource.FromResource(resource, typeof(ShellItemRenderer).GetTypeInfo().Assembly);

            Native.Image icon = new Native.Image(System.Maui.Maui.NativeParent);
            var          task = icon.LoadFromImageSourceAsync(src);

            item.SetPartContent("elm.swallow.icon", icon);
            item.SetPartColor("bg", _backgroudColor);
            item.SetPartColor("underline", EColor.Transparent);
        }
Beispiel #2
0
        void CreateMoreToolbarItem()
        {
            if (_moreToolbarItem != null)
            {
                return;
            }

            //The source of icon resources is https://materialdesignicons.com/
            ImageSource src = ImageSource.FromResource("Xamarin.Forms.Platform.Tizen.Resource.dots_horizontal.png", typeof(ShellItemRenderer).GetTypeInfo().Assembly);

            Native.Image icon = new Native.Image(Forms.NativeParent);
            var          task = icon.LoadFromImageSourceAsync(src);

            _moreToolbarItem = _toolbar.Append("More", null);
            _moreToolbarItem.SetPartContent("elm.swallow.icon", icon);
            _moreToolbarItem.SetPartColor("bg", _backgroudColor);
            _moreToolbarItem.SetPartColor("underline", EColor.Transparent);
            _toolbarItemList.AddLast(_moreToolbarItem);
        }
Beispiel #3
0
 public static void SetIconPart(this EToolbarItem item, EvasObject content, bool preserveOldContent = false)
 {
     item.SetPartContent(ThemeConstants.ToolbarItem.Parts.Icon, content, preserveOldContent);
 }