Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8111159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:00:24+00:00 2026-06-06T02:00:24+00:00

I have a multi-xaml metro app. I want to switch between xaml by button

  • 0

I have a multi-xaml metro app. I want to switch between xaml by button click.

private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        Window.Current.Content = new BlankPage1();
        this.InitializeComponent();
    }

    private void Button_Click_2(object sender, RoutedEventArgs e)
    {
        Window.Current.Content = new Sudoku.sudoku();
        Window.Current.Activate();            
    }

    private void Button_Click_3(object sender, RoutedEventArgs e)
    {
        TextTwist.text_twist ob= new TextTwist.text_twist();
        ob.InitializeComponent();
        Window.Current.Content = ob;           
    }

This is the logic code for the main xaml having buttons.
Now when I click button1 (/button2/button3), the corresponding xaml comes on screen, but the associated images are not loaded.
They are perfectly visible in the designer otherwise.

Please help me out.

Here is 1 of the xaml snippet

<Grid x:Name="gridMain">
    <Grid.Background>
        <ImageBrush ImageSource="Assets/textTwist/blue_back.png"/>
    </Grid.Background>
    <ListView x:Name="lv"  HorizontalAlignment="Left" Height="565" Margin="49,99,0,0" VerticalAlignment="Top" Width="315" SelectionChanged="ListView_SelectionChanged_1" Opacity="0.95" FontSize="128">
        <ListView.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="1"/>
                <GradientStop Color="#FF9CF147" Offset="0.261"/>
            </LinearGradientBrush>
        </ListView.Background>
    </ListView>
    <TextBox x:Name="txtblk" HorizontalAlignment="Left" Margin="436,207,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="126" Width="731" FontSize="72" AcceptsReturn="True" FontWeight="Bold" BorderThickness="0" Foreground="#FFF01D1D" CharacterSpacing="120">
        <TextBox.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black"/>
                <GradientStop Color="White" Offset="0.874"/>
            </LinearGradientBrush>
        </TextBox.Background>
    </TextBox>
    <Button x:Name="btnSubmit" Content="Submit Word" HorizontalAlignment="Left" Margin="874,479,0,0" VerticalAlignment="Top" Width="293" Click="btnSubmit_Click" Height="96" FontSize="36" FontWeight="Normal" FontFamily="Segoe Print">
        <Button.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black"/>
                <GradientStop Color="#FF7DE09C" Offset="0.926"/>
            </LinearGradientBrush>
        </Button.Background>
    </Button>
    <Image x:Name="imgWrong" HorizontalAlignment="Left" Height="277" Margin="436,433,0,0" VerticalAlignment="Top" Width="280" Source="Assets/textTwist/wronganswer.png" Stretch="UniformToFill" Visibility="Collapsed"/>
    <Image x:Name="imgRight" HorizontalAlignment="Left" Height="277" Margin="436,433,0,0" VerticalAlignment="Top" Width="280" Source="Assets/textTwist/rightanswer.png" Visibility="Collapsed"/>
    <Image HorizontalAlignment="Left" Height="146" Margin="480,28,0,0" VerticalAlignment="Top" Width="624" Source="Assets/textTwist/text-twist-turbo-art.jpg" Stretch="UniformToFill"/>
</Grid>

The associated images being the grid background images, button images etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:00:25+00:00Added an answer on June 6, 2026 at 2:00 am

    set your image source with the format ms-appdata or ms-appx

    <Image Source="ms-appdata:///local/myFileNotInTheAppPackage.png"/>
    
    <Image Source="ms-appx:///Assets/myFilePartOfMyAppPackage.png"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 listboxes in my XAML and both of them are multi select.
I have a multi threaded .NET app that uses async I/O and AsyncCallbacks to
I have an multi-dimensional array that I want to send to a PHP script
i have multi pages pdf,i want to go to the next page of pdf,
I have multi-thread application that I want to create a thread with different user
I have this message: image pyimage2 doesn't exist . I want to have multi
So I want to make my page to have multi language function, like German,
I have multi-language website in Drupal, but not all content is translated. I want
In my app I have a button, when the user clicks it, it brings
I have multi-lines textbox in c# window-base application. If user click on textbox I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.