Пример #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var fileName = (string)value;

            string result = null;

            if (!string.IsNullOrEmpty(fileName))
            {
                result = IsolatedStorageHelper.FileExist(fileName)
                    ? fileName
                    : IsolatedStorageHelper.GetFilePath(fileName);
            }

            if (string.IsNullOrEmpty(result))
            {
                result = (bool)parameter ? "img_empty_big.png" : "img_empty_small.png";
            }

            return(result);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var fileName    = (string)value;
            var imageSource = "";

            if (IsolatedStorageHelper.FileExist(fileName))
            {
                imageSource = fileName;
            }
            else
            {
                imageSource = IsolatedStorageHelper.GetFilePath(fileName);
            }

            if (String.IsNullOrWhiteSpace(imageSource))
            {
                imageSource = Device.OnPlatform("Image/image.png", "ic_image.png", "Assets/Image/image.png");
            }

            return(imageSource);
        }