示例#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);
        }
示例#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,
            };
        }
示例#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();
        }
示例#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
        }
示例#5
0
 public ContainerView(IMauiContext context) : this(context.GetNativeParent(), context)
 {
 }