/// <summary> /// Initializes a new instance of the CaptionSettingsFlyoutViewModel class. /// </summary> public CaptionSettingsFlyoutViewModel() { #if WINDOWS_PHONE this.PreviewText = Resources.AppResources.PreviewText; if (DesignerProperties.IsInDesignTool) { this.Settings = new CustomCaptionSettings(); } var defaultText = Resources.AppResources.Default; #else var resources = AssemblyResources.Get(); this.PreviewText = resources.GetString("PreviewText"); var defaultText = resources.GetString("Default"); #endif this.FontFamilies = new FontFamily[] { FontFamily.Default, FontFamily.MonospaceSerif, FontFamily.ProportionalSerif, FontFamily.MonospaceSansSerif, FontFamily.ProportionalSansSerif, FontFamily.Casual, FontFamily.Cursive, FontFamily.Smallcaps }; this.FontSizes = new string[] { defaultText, "50", "100", "150", "200" }; this.FontStyles = new FontStyle[] { FontStyle.Default, FontStyle.None, FontStyle.RaisedEdge, FontStyle.DepressedEdge, FontStyle.Outline, FontStyle.DropShadow }; }
/// <summary> /// Convert from a ColorType to its string equivalent /// </summary> /// <param name="value">the ColorType</param> /// <param name="targetType">the target type</param> /// <param name="parameter">not used</param> /// <param name="language">the language</param> /// <returns>a string</returns> public object Convert(object value, Type targetType, object parameter, string language) { ColorType colorType = (ColorType)value; if (this.loader == null) { this.loader = AssemblyResources.Get(); } var text = this.loader.GetString(colorType.ToString()); if (string.IsNullOrEmpty(text)) { return(value.ToString()); } return(text); }
/// <summary> /// Convert from a caption font to a Font Family /// </summary> /// <param name="value">a string</param> /// <param name="targetType">a FontFamily type</param> /// <param name="parameter">not used</param> /// <param name="language">language not used</param> /// <returns>a <see cref="FontFamily"/></returns> public object Convert(object value, Type targetType, object parameter, string language) { if (this.loader == null) { this.loader = AssemblyResources.Get(); } var text = this.loader.GetString(value.ToString()); if (string.IsNullOrEmpty(text)) { System.Diagnostics.Debug.WriteLine("No localized resource for {0}", value); return(value.ToString()); } return(text); }