public async Task <IList <RecipeGroup> > GetRecipeGroups() { var obj = new { Groups = new List <RecipeGroup>() }; var result = JsonConvert.DeserializeAnonymousType(await AppResourceHelper.GetEmbeddedResourceAsStringAsync("Data/RecipeData.json"), obj); return(result.Groups); }
protected CodeBrixApplication(IPlatformConfiguration platformConfig) : base(platformConfig?.Initializer) { //Important: The following code won't run until the base constructor has completed; // so the PlatformConfiguration property may be null during the earliest parts of application startup. PlatformConfiguration = platformConfig ?? throw new ArgumentNullException(nameof(platformConfig)); if (PlatformConfiguration.Container == null) { throw new ArgumentException("The 'Container' property of the platform configuration cannot be null.", nameof(platformConfig)); } AppResourceHelper.SetApplication(this); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { bool val = (bool)value; Color result = XamFormsColorHelper.DefaultColor; //get default color if (!String.IsNullOrWhiteSpace(parameter?.ToString())) { string param = parameter.ToString() .Trim() .Split(';') .FirstOrDefault( f => (f ?? "").Trim() .StartsWith(val.ToString().ToLower() + ":")); if (!String.IsNullOrWhiteSpace(param)) { result = AppResourceHelper.GetColorByKey(param.Replace(val.ToString().ToLower() + ":", "")); } } return(result); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return(((string)value == null) ? null : AppResourceHelper.GetAppResourceUri((string)value)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return(((string)value == null) ? null : ImageSource.FromStream(() => new MemoryStream(AppResourceHelper.GetEmbeddedResourceAsBytes((string)value)))); }