Open new page outside masterdetailpage - c#

I just new to Xamarin.Form with Prism. I want to load the page in different behavior. The first one I achieve already is in image below.
But I want to do a behavior like below image. Load a new page outside master detail page. How can I do it in prism?

You have figured out how to display the "Hamburger" icon as well as title by doing the following.
NavigationService.NavigateAsync("MasterPage/NavigationPage/DetailsPage")
If a user makes a selection from the actions listed on the master page. For Example, let's say settings.
You have a couple of options here, you can do navigate relatively
NavigationService.NavigateAsync("Settings")
This will navigate to the settings page. This will also display the back button as the second image. Your current page path will be
MasterPage/NavigationPage/DetailsPage/Settings
Now let's say you want the settings page to be the top details page. You have to navigate to it via an absolute path.
MasterPage/NavigationPage/Settings
NavigationService.NavigateAsync("MasterPage/NavigationPage/Settings")

You need to add a new page to the stack, page over existing one. To do that you should do navigation like this:
navigationService.NavigateAsync("Settings")

Related

Webdriver access elements of a page which is embedded in div of parent page

We have a page(URL 2) which is embedded or loaded in Div element(Popup) of another page(master page) when a button is clicked on master page(URL 1).
I am not able to access the elements on this embedded page.
The firepath developer plugin shows, there are two objects (Top Window URL 1 and another with different URL 2). When I try to highlight any element with xpath locator on page 2 URL 2, its not successful as the object/document selected is Top Window. In order to access elements on page 2, the document needs to be changed.
Tried using SwitchTo method but no luck. The embedded page is niether loaded in a separate window nor in Iframe.
SwitchTo method can only be used if another window is opened or Iframe is present on page.
Does anyone have any ideas or solutions to change the document context so that all new commands are sent to this new page 2.
I am using C# bindings v2.53.
Thanks in advance.
Try to use:
driver.SwitchTo().Window(driver.WindowHandles.ToList().Last());
I got the problem and eventually answer to that.
Its really simple. Its simply working out with jquery.
{driver.executeScript("return $('body /deep/ <#yourSelector>')}
this piece of code simply draws the element from shadow DOM and which can be further used to simulate user actions... :)

How to store state in Windows 8.1 using Blank Page Template?

I am migrating my Windows Phone 8 App to Windows 8.1 App and I have created a Page with blank page template. In that there are some Items like TextBlock,ComboBox and TextBox. Now, there is an item LocationTextBlock with border around it. When I click on it, it navigates to a new Page LocationPage, where I need to select location and save that object and navigate using Frame.GoBack() method. Now the issue, when I navigate back, I get the object of LocationData but the LocationTextBlock which was created previously is showing null, so I can't populate Location in that TextBlock.
Questions
Is this issue occurring due to Blank Page Template ?
Can it be solved using NavigationHelper Class?
Will using Basic Page Template resolve this issue?
Please suggest with some code or description, whether it can be done using Blank Page template as I have added many lines of code inside it.
It can be done with Blank Page template (although using NavigationHelper would be the prefered way).
What you have to do is set NavigationCacheMode to Enabled in your Page's Constructor:
this.NavigationCacheMode = NavigationCacheMode.Enabled;
This way the Page with all the properties in it is cached. So when you navigate back you get back the state in which the Page was when you navigated from it. However, if you navigate to this page not through backnavigation, you'll still get back the saved state, which you don't want. The solution is to clean up all the resources (initializing the needed variables, setting UI elements to default value etc.) in the OnNavigatedTo(NavigationEventArgs e) method if (e.NavigationMode != NavigationMode.Back). Don't know if it's the best approach, but it'll work.
EDIT:
You could even use a Flyout or a ContentDialog instead of your LocationPage, so you don't need to navigate from the page, thus not needing to cache/save the page.

how to hide the master page content in a web page

I want to open a regular .aspx page in a rad window.But the regular page consists of Site Map.I don't want that sitemap to be displayed when it is opened in rad window.
Please suggest me some solution.
I already tried this:
this.MasterpageFile="..//test.Master";
But in my page it does not work
So you will have ContentPlaceHolders which will automatically inherit from the master page. If you go to the regular .aspx page and head into Design view you will see sections with all the content from the Master Page.
If you click the little right arrow to the right of the area that looks like a Div, you should be able to change the content back to what you have in your regular aspx page.
Make a public property on MasterPage to show hide your site map , on your rad window page access that Property and make it hide.
public bool MyProperty()
{
// get and set your controls visibility
}
Access your property like this.Master.MyProperty = false

Navigating between DotNetNuke module controls using EditURL() or NavigateURL()

OK I'm new to DotNetNuke and need to write a simple module in DNN that will display an article for everyone, and allow the admin to edit the article/add a new one.
I have a test page that contains a DNN module with one module definition and two controls in that definition. The default control shows the article based on an articleID field in the querystring. You then click a button that is supposed to load the edit control and pass the articleID in the query string.
If I use EditURL() in the onClick the edit control is loaded with the correct articleID, but using the admin skin. If I use Globals.NavigateURL() then the correct skin is shown but my edit control isn't loading in the page.
Any clue as to how to what I'm doing wrong or how to get the edit control loading with the correct skin?
My two methods of switching to the edit control (in my button click event) are listed below:
string newURL = this.EditUrl("articleID", Request.QueryString["articleID"], "EditArticle");
Response.Redirect(newURL);
and
string newURL = Globals.NavigateURL(this.TabId, "EditArticle","articleID="+Request.QueryString["articleID"]);
Response.Redirect(newURL);
Actually you are doing this correctly - the editurl in DNN does load the Admin skin - usually this skin is based on someone administering content so it strips out all other modules and shows the 'basics'. Right or wrong this is what it does.
If you dont want to to do that you could provide a switch in the querystring and show a seperate panel or do a multiview control and show different views based on the switch in the query string.
There are a few other approaches like changing the content area to editing text area with ajax or using popup modal style windows.

Can you change a master page's ContentPlaceHolder's Content Page Asynchronously in .NET?

From what I've already read this appears to be impossible, but I wanted to see if anyone out there has a secret trick up their sleeve or at least a definitive "no".
Supposedly a master page is really just a control for a content page to use, not actually the "master" of a content page. If I wanted to go from one content page, to another content page with the same master page, I would just say
Response.Redirect("PageB.aspx");
But this would immediately cause a postback, flickering the page, which is the crappy pre-ajax way of doing things.
In this current project, I'm trying to see if I could figure out how to change the current content page of a ContentPlaceHolder in the master page asynchronously, when a button is clicked on the master page.
Is this possible, if so how?
I don't know if you can between pages (.aspx) but it can definitely be done using UserControls.
ASP.Net pages each have their own URL so what you're trying to do is to go from one URL to another without any postback, that's just not how it's supposed to work.
Using user controls (.ascx):
Create a page that uses the MasterPage and use something like this in the content
<ajax:UpdatePanel ...>
<ContentTemplate>
<asp:PlaceHolder ...>
</ContentTemplate>
</ajax:UpdatePanel>
Search for UpdatePanel and tweak its settings to do what you want, then learn how to swap user controls in a placeholder.
No, you cannot because a master page is actually a control rendered on a particular aspx page, rather than actually containing the aspx page as it deceptively appears to be programmatically and in design view.
More Info:
You could however use a variety of other controls to simulate this effect. The asp:MultiView control is one example, each "page" could be made in a single view and placed in an update panel, thus allowing it to be switched asynchronously. Alternatively you could define each page in a separate user control and put those in an update panel, asynchronously switching the visible property on those controls as needed.
There are really a lot of different ways to achieve an effect similar to changing the master page's content placeholder.

Categories

Resources