Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public ShellSearchResultList(IMauiContext context) : base(context?.GetPlatformParent())
        {
            MauiContext = context;

            SetAlignment(-1, -1);
            SetWeight(1, 1);
            AllowFocus(true);

            Homogeneous     = true;
            SelectionMode   = GenItemSelectionMode.Always;
            BackgroundColor = EColor.White;

            _defaultClass = new GenItemClass(TThemeConstants.GenItemClass.Styles.Full)
            {
                GetContentHandler = GetContent,
            };
        }
Ejemplo n.º 3
0
        public ShellSectionStack(ShellSection section, IMauiContext context) : base(context.GetPlatformParent())
        {
            ShellSection = section;
            MauiContext  = context;

            SetAlignment(-1, -1);
            SetWeight(1, 1);
            SetLayoutCallback(OnLayout);

            _viewStack = new SimpleViewStack(PlatformParent);
            if (DeviceInfo.Idiom == DeviceIdiom.Phone)
            {
                _viewStack.BackgroundColor = ElmSharp.Color.White;
            }
            _viewStack.Show();
            PackEnd(_viewStack);

            InitializeComponent();
        }
Ejemplo n.º 4
0
        public static Task <IImageSourceServiceResult <PlatformImage>?> GetPlatformImageAsync(this IImageSourceService imageSourceService, IImageSource?imageSource, IMauiContext mauiContext)
        {
            if (imageSource == null)
            {
                return(Task.FromResult <IImageSourceServiceResult <PlatformImage>?>(null));
            }

#if IOS || MACCATALYST
            return(imageSourceService.GetImageAsync(imageSource));
#elif ANDROID
            return(imageSourceService.GetDrawableAsync(imageSource, mauiContext.Context !));
#elif WINDOWS
            return(imageSourceService.GetImageSourceAsync(imageSource));
#elif TIZEN
            var platformImage = new PlatformImage(mauiContext.GetPlatformParent());
            return(imageSourceService.GetImageAsync(imageSource, platformImage));
#else
            throw new NotImplementedException();
#endif
        }
Ejemplo n.º 5
0
 public ContainerView(IMauiContext context) : this(context.GetPlatformParent(), context)
 {
 }