Resources » Code Snippets » Application windows, menus & toolbars

Background Image of Window or Page in WPF


Last Updated:   Category: Application windows, menus & toolbars    
Author: Member Level: Gold    Points: 10



Background Image of Window or Page in WPF



This Code Snippet produce Background Image of Window or Page



For Window


< Window x:Class="MyXbap.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" >
< !-- define Background Property -- >
< Window.Background >
< !-- Define Image Bruch and Set Image Source to Image Path-- >
< ImageBrush ImageSource="Beach.jpg" >< /ImageBrush >
< /Window.Background >
< /Window >



For Page



< Page x:Class="MyXbap.Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:triple="http://thriple.codeplex.com/"
Title="Page2" Width="1000" Height="1000" >
< !-- define Backgroudn Property of Page- >
< Page.Background >
< !-- define Image Brush and Set ImageSource Property -- >
< ImageBrush ImageSource="Beach.jpg" >< /ImageBrush >
< /Page.Background >
< /Page >



Note:- Make Sure Image Property Copy to Image Directory to Copy always

Attachments


Background Image of Window or Page in WPF .


Did you like this resource? Share it with your friends and show your love!

Responses to "Background Image of Window or Page in WPF"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Awards & Gifts
    Talk to Webmaster Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India