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); }
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, }; }
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(); }
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 }
public ContainerView(IMauiContext context) : this(context.GetPlatformParent(), context) { }