public BackgroundViewModel() { var brushes = new List <Brush> { new SolidColorBrush(Colors.BlueViolet), new ImageBrush(new BitmapImage(new Uri("http://i.stack.imgur.com/jGlzr.png", UriKind.Absolute))), new LinearGradientBrush(Colors.Black, Colors.White, 45) }; BackgroundOptions = brushes; SelectedBackground = BackgroundOptions.FirstOrDefault(); }
/// <summary> /// Convert BackgroundOptions of UIComponents.Extensions to NativeBackgroundOptions /// </summary> /// <param name="option">BackgroundOptions</param> /// <returns>Returns elmsharp background option</returns> EBackgroundOptions ConvertToNativeBackgroundOptions(BackgroundOptions option) { Console.WriteLine("ConvertToNativeBackgroundOptions : " + option); if (option == BackgroundOptions.Stretch) { return(EBackgroundOptions.Stretch); } else if (option == BackgroundOptions.Tile) { return(EBackgroundOptions.Tile); } else { return(EBackgroundOptions.Scale); } }
EBackgroundOptions ConvertToNativeBackgroundOptions(BackgroundOptions option) { if (option == BackgroundOptions.Center) { return(EBackgroundOptions.Center); } else if (option == BackgroundOptions.Stretch) { return(EBackgroundOptions.Stretch); } else if (option == BackgroundOptions.Tile) { return(EBackgroundOptions.Tile); } else { return(EBackgroundOptions.Scale); } }
internal static extern void elm_bg_option_set(IntPtr obj, BackgroundOptions option);