Esempio n. 1
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);
        }
Esempio n. 2
0
        public ShellSearchResultList(IMauiContext context) : base(context?.GetNativeParent())
        {
            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,
            };
        }
Esempio n. 3
0
        public ShellSectionStack(ShellSection section, IMauiContext context) : base(context.GetNativeParent())
        {
            ShellSection = section;
            MauiContext  = context;

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

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

            InitializeComponent();
        }
Esempio 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.GetNativeParent());
            return(imageSourceService.GetImageAsync(imageSource, platformImage));
#else
            throw new NotImplementedException();
#endif
        }
Esempio n. 5
0
 public ContainerView(IMauiContext context) : this(context.GetNativeParent(), context)
 {
 }