Image attached properties to make x:Phase work with BitmapImage source

Today I wanted to do a pretty simple thing - use UWP x:Phase on an Image object inside a DataTemplate, but also set the DecodePixelWidth/DecodePixelHeight properties on a BitmapImage source to ensure that the decoded image width/height is optimal. Turns out, it's not exactly such a simple thing, so I wrote a couple of attached properties to make it simpler. This is what I tried to do: <Image x:Name="Image" Stretch="Uniform" MaxWidth="120" x:Phase="2"> <Image.Source> <BitmapImage UriSource="{x:Bind image_url}" DecodePixelWidth="120" DecodePixelType="Logical" /> <…

Read More

MVP Reconnect - say hi on Twitter

Microsoft MCSD

profile for igrali at Stack Overflow, Q&A for professional and enthusiast programmers

Latest Posts