/// <summary> /// Converts NavigationPoint.Level to Thickness. /// </summary> /// <param name="value">The source data being passed to the target.</param> /// <param name="targetType">The System.Type of data expected by the target dependency property.</param> /// <param name="parameter">An optional parameter to be used in the converter logic.</param> /// <param name="culture">The culture of the conversion.</param> /// <returns>The value to be passed to the source object.</returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Elements.Image image = (Elements.Image)value; Book book = (Book)parameter; Stream stream; using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { stream = isf.ReadStream(Path.Combine(book.GetImagesDirectory(), image.FileName)); } BitmapImage bi = new BitmapImage(); bi.SetSource(stream); stream.Close(); return(bi); }
protected override void OnAwake() { base.OnAwake(); a_ImageElement = gameObject.GetComponent(typeof(Elements.Image)) as Elements.Image; }