Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Loading images from resources #21

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Nearga
Copy link
Contributor

@Nearga Nearga commented Nov 10, 2013

  1. If value = "/Resources/Image/MyImage.png" (or whatever), it would be loaded and
    rendered.
  2. If string is null, it would load temporary image
    (Constants.RESOURCE_IMAGE_EMPTY_PRODUCT =
    "/Resources/Image/DummyImage.png")

1. If value = "/Resources/Image/MyImage.png", it would be loaded and
rendered.
2. If string is null, it would load temporary image
(Constants.RESOURCE_IMAGE_EMPTY_PRODUCT =
"/Resources/Image/DummyImage.png")
@Nearga
Copy link
Contributor Author

Nearga commented Nov 10, 2013

Actually, you can also add to line 36.

        imageUri = String.IsNullOrEmpty(value as string) 
                    ? new Uri(Constants.RESOURCE_IMAGE_EMPTY_PRODUCT, UriKind.Relative) 
                    : new Uri((string)value);

For handling, if string is empty.

Fixed usage of imageUri.Scheme for Relative cases (somehow, sometimes it
throws exception, now it is fixed).
@Nearga
Copy link
Contributor Author

Nearga commented Nov 10, 2013

Fixed usage of imageUri.Scheme for Relative cases (somehow, sometimes it
throws exception, now it is fixed).

Even faster way. Works for all cases for me:
- if to have empty string or null,
- if to have local path
@Nearga
Copy link
Contributor Author

Nearga commented Nov 10, 2013

Cleaner code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant