I'm searching for a good and fast way to load images as background brushes to Windows 10 Mobile UWP XAML pages (Grid background).
Currently I do this like the following:
- Define ImageBrush in Page.Resources section
- Use defined ImageBrush and set Background to this resource
First step:
<Page.Resources>
<ImageBrush x:Key="background" ImageSource="msappx:///Assets/Background/bg_login.jpg"
Stretch="UniformToFill" Opacity="0.25"/>
</Page.Resources>
Second step:
<Grid Background="{StaticResource background}">
<Grid.CacheMode>
<BitmapCache />
</Grid.CacheMode>
<!-- Some other UI components -->
</Grid>
Unfortunately when the page comes up for the first time, the background brush needs at least 1.5 seconds to be displayed. So in the meantime, there is just a white background, which is not what I want to achieve. My background image "bg_login.jpg" is already compressed to round about 40kb.
Is there a faster way to display the image as a grid background? Or do I maybe have the opportunity to load the image while the splashscreen is showing?
Any help would be greatly appreciated. Thanks in advance.