Answered by:
how to transwer a image one xaml to another xaml while clicking a button in metro style using c++ language.

Question
-
how to transwer a image one xaml to another xaml while clicking a button in metro style using c++ language.Friday, July 20, 2012 3:11 AM
Answers
-
I believe this is what Sagar was suggesting. MainPage.XAML has two images, two buttons and a frame. There are two other XAML pages which the MainPage buttons use for displaying in the frame. When Page1 or Page2 load, they load the ImageSource passed in the Frame->Navigate call.
//MainPage.XAML.cpp void FrameNavigationParamPassing::MainPage::b1_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { TypeName p1 = { "FrameNavigationParamPassing.Page1", TypeKind::Custom }; auto a = img1->Source; f1->Navigate(p1, a); } void FrameNavigationParamPassing::MainPage::b2_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { TypeName p1 = { "FrameNavigationParamPassing.Page2", TypeKind::Custom }; auto a = img2->Source; f1->Navigate(p1, a); }
Code from one of the XAML pages loading in the frame that uses the ImageSource^ parameter.
//Page1.XAML.cpp void Page1::OnNavigatedTo(NavigationEventArgs^ e) { auto imgSource = dynamic_cast<Windows::UI::Xaml::Media::ImageSource^>(e->Parameter); //Set the Page1 Image source property i1->Source = imgSource; }
David Lamb
- Marked as answer by Bilaal John S Thursday, July 26, 2012 11:49 AM
Wednesday, July 25, 2012 5:28 PMModerator -
All replies
-
Hi Sarath,
When you say transfer do you mean from from XAML page to another? If so, then you can pass it as a parameter while navigating to the other XAML page with Frame::Navigate.
-Sagar
Friday, July 20, 2012 3:34 PMModerator -
Hi,
thank you for your valuable comments.
Regards,
Sarath s
- Edited by Bilaal John S Wednesday, August 15, 2012 10:31 AM
Monday, July 23, 2012 6:18 AM -
-
I believe this is what Sagar was suggesting. MainPage.XAML has two images, two buttons and a frame. There are two other XAML pages which the MainPage buttons use for displaying in the frame. When Page1 or Page2 load, they load the ImageSource passed in the Frame->Navigate call.
//MainPage.XAML.cpp void FrameNavigationParamPassing::MainPage::b1_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { TypeName p1 = { "FrameNavigationParamPassing.Page1", TypeKind::Custom }; auto a = img1->Source; f1->Navigate(p1, a); } void FrameNavigationParamPassing::MainPage::b2_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { TypeName p1 = { "FrameNavigationParamPassing.Page2", TypeKind::Custom }; auto a = img2->Source; f1->Navigate(p1, a); }
Code from one of the XAML pages loading in the frame that uses the ImageSource^ parameter.
//Page1.XAML.cpp void Page1::OnNavigatedTo(NavigationEventArgs^ e) { auto imgSource = dynamic_cast<Windows::UI::Xaml::Media::ImageSource^>(e->Parameter); //Set the Page1 Image source property i1->Source = imgSource; }
David Lamb
- Marked as answer by Bilaal John S Thursday, July 26, 2012 11:49 AM
Wednesday, July 25, 2012 5:28 PMModerator -
thankz David..Thursday, July 26, 2012 5:45 AM