I have a website and now I`m building a WinRT app for it. I use a JSON API both for web and for WinRT app.
One component is a picture gallery, where pictures have access control, so only specific users can download them.
Authorization is made using cookies, for WinRT they are held inside System.Net.Http.HttpClient
object.
I tried to bind picture url`s as ImageSource
for Image
controls, but it fails because resource loader doesn`t send cookies to server.
I want to use binding because of it cleareness and simplicity, I don`t want to make complex code for such task as setting image inside a view.
Questions:
How can I bind ImageSource
and force loader to send cookies to server when it tries to download a picture?
Is there a way to save simplicity of binding syntax and add custom loader behavior?
I ended up with custom control with Source and HttpClient properties, which uses HttpClient to download picture and this client is shared across all app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With