I am Working On visual studio for metro app development for windows 8 pc .Is it Possible to navigate to "html webpage" when clicked on group1 and to "another webpage" when clicked on group2, when selecting project as "Split App" . In fact i just want to create some group and there transition to different webpage.
You should change the code in the item clicked event:
So, instead of the Frame.Navigate in the following code, get the website you want to navigate to from the clicked item and launch it to the web browser
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
// Navigate to the appropriate destination page, configuring the new page
// by passing required information as a navigation parameter
var groupId = ((SampleDataGroup)e.ClickedItem).UniqueId;
this.Frame.Navigate(typeof(SplitPage), groupId);
}
Related
I am developing an APP using Xamarin, i trying to apply an consistent navigation system for my app.
I have used xamarin master detail navigation and binded the master page with few details page through ObservableCollection list.
My default details page is again a tabbled page. Within Tabled page on click of some button i need open some content page which are not part of master page.
What i want is- any conent page should open within the master page means from any content page master page's header and left sliding menu should be easily available to user.
I am tryng to bind master page from content page on runtime but no luck yet. Please help.
====updating my query for better understanding===
1. Sample master details page look like below
[1
Click on item 1 open page 1 with sliding icon on left side of page title
Click on "GO TO PAGE 3" open page 3 with navigation back button. I think as this page is not bind to master page it shows normal back button. Basically i want to replace this navigation back button with "master detail" sliding button in every page those are not part of master page.
Please let me know how to replace navigation back button icon and behavior with master detail sliding button. I know following line of code can be used to open sliding menu but do not know how to hook the back button even.
(App.Current.MainPage as MasterDetailPage).IsPresented = true;
I am currently using White/TestStack to test a windows app.
There are scenarios that requires user to click on links to open pages on browser. How do I check the hyperlink is working?
Old question but in case somebody else looking for an answer:
If you check in the White GitHub repository and you browse the UITests and the control tests, you will find the Hyperlink control test. In the sourcecode, you will find several tests according the type of framework used.
The simplest one:
var hyperlink = MainWindow.Get<Hyperlink>("LinkLabel");
hyperlink.Click(10, 10);
Assert.That(hyperlink.HelpText, Is.EqualTo("Hyperlink Clicked"));
The test is based on the used of code-behind for the MainWindow:
private void Hyperlink_OnClick(object sender, RoutedEventArgs e)
{
AutomationProperties.SetHelpText(LinkLabel, "Hyperlink Clicked");
}
XAML code of the hyperlink in the MainWindow
<TextBlock x:Name="LinkLabelContainer">
<Hyperlink x:Name="LinkLabel" Click="Hyperlink_OnClick">Link Text</Hyperlink>
</TextBlock>
So you can used the same method.
TL;DR
You can link the Click() event of your hyperlinks to a method in code behind which update the automation property HelpText of the hyperlink with a specific value for the clicked event.
So in your tests, you will just have to perform the click and then check the automation property value.
I refer from this StackOverflow question, regarding to MVVM Light:
I am trying to have a hamburger menu style navigation (see this
sample). app by Microsoft on an example of how to do this) to:
1- have a convenient solution shared across all my pages. The sample
mentioned above uses an AppShell Page as the root of the app instead
of a Frame, that encapsulates the navigation menu and some behavior of
the back button. That would be ideal.
2- Use the MVVM-Light navigation service to handle all the navigation
from my view model conveniently.
Here is how the App.xml.Cs initializes the shell page onLaunched:
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
var shell = Window.Current.Content as AppShell;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (shell == null)
{
// Create a AppShell to act as the navigation context and navigate to the first page
shell = new AppShell();
// Set the default language
shell.Language = ApplicationLanguages.Languages[0];
shell.AppFrame.NavigationFailed += OnNavigationFailed;
}
// Place our app shell in the current Window
Window.Current.Content = shell;
if (shell.AppFrame.Content == null)
{
// When the navigation stack isn't restored, navigate to the first page
// suppressing the initial entrance animation.
var setup = new Setup(shell.AppFrame);
setup.Initialize();
var start = Mvx.Resolve<IMvxAppStart>();
start.Start();
}
// Ensure the current window is active
Window.Current.Activate();
}
The thing is, as long as i navigate over the menu proviced by the AppShell everything works. But the ShowViewModel from MVVM Cross doesn't have any effect.
I thought there shouldn't be any difference if pass the shell as Frame or the frame set on the AppShell.
Does anyone have an idea what I can do about this or if there is an example with a working hamburger menu with MVVM cross?
The repository is open source on GitHub if you need an better overview or so.
https://github.com/Apply-Solutions/MoneyManager
I use MVVM Cross v4.0.0.0-beta1. Beta2 has currently another issue who prevents building in a UWP.
Thanks
NPadrutt
Not entirely sure what you are trying to do, but what you will probably need to navigate pages with a hamburger menu in a UWP app using MvvmCross as a framework, is a custom presenter, which handles the ShowViewModel method, and displays the associated view for the requested ViewModel in your hamburger container view.
Okey this embarrassing. The issue was that the View for the ViewModel couldn't be resolved. And the reason for that was that I didn't replace the inheritance from page to views:MvxWindowsPage.
With this, everything works with the default page presenter.
EDIT: in order to work with the navigation in the app shell, these pages need to be Pages. So you may either have to rewrite the navigation in the Appshell or may not adjust all Pages to MvxPage.
I am developing on alarm based application
I want to add one setting page to my app. I want to change image of Image control which is on my Mainpage. image should be changing when button click event occurs from setting page. All Images are stored in my simple local folder of application like assets folder. please help me
So you could do simply like this, within your button click event handler:
BitmapImage imgSource = new BitmapImage(
new Uri("/PivotApp1;component/Images/halfstar.png", UriKind.Relative));
imageName.Source = null;//imageName is the name of the image control
imageName.Source = imgSource;
For more you could refer these:
On Button Press - Change Image Source
Imagebutton change source property
To show multiple images, you could use the image sliding. Reference
Hope it helps!
If you're looking for an example of a settings page, check out my app templates: Universal version and Silverlight (WP 8.0) version - they both have a settings page and an example of how to respond to when a setting changes.
I am new to Windows Phone Programming.
How can i add an action to each item on windows phone data-bound app list.
in Android Programming we could add on Click listener to add an action to a button or to a list it
em.How can we do such a thing in windows phone template (data bound app)
her
i want when i click on a list item it opens another class or do something .
You can use ListBox to display list of data.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.controls.listbox(v=vs.105).aspx
Then you can use its "SelectionChanged" event & perform action which you want.
You can use "SelectedItem" property to check which item is selected by user.
For more details on "LIstBox", refer this article : http://www.geekchamp.com/tips/wp7-listbox-selecteditem