Create dynamic Page XAML - xaml

I am new to WP8 app dev.
Scenario:
WP application client and Server
Application will display content received from server
Response from server has 2 types : list item page or detail page.
Question:
When server responses a list, Client app must be create a dynamic list Page with data from server
When user click an item on list, server may response a list (cont.) or a detail of this item (user dont know list or detail).
Please recommend a solution for this case support Navigation Back pressed? (only create a page using object parameter response from server)
Start page -> List -> List-> List->List-> Detail Page.
or : Start page -> List -> Detail Page.

Your question is unclear, but I will try to resolve the ambiguity. If the data from the server is just that - data, then you don't need to create XAML dynamically, you should use LongListSelector for displaying arbitrary lists of data. This is the case when the amount of data is unspecified, but the structure is the same. See MSDN link for more information.
When you get the details from the server, simply use data binding to fill predefined controls on the page. You can always hide unused controls.
In case that the data that comes from the server changes UI in a way that cannot be predetermined e.g. each list looks completely different and details page is also variable, you should create XAML on the fly. Simply create empty pages and in the constructor add controls. For example:
// ListPage.xaml
<ScrollViewer>
<StackPanel x:Name="panel">
</StackPanel>
</ScrollViewer>
// ListPage.xaml.cs
public ListPage()
{
InitializeComponent();
foreach(var data in somesource)
{
if (...)
panel.Children.Add(new TextBlock());
else
panel.Children.Add(new TextBox());
// ...
}
}

Why don't you use like this:
Have 2 pages ,First One for List View and the Second for Details view.
Based on the server responses pass the data to corresponding pages,whichever you want.You are not allowed to create pages dynamically and use them.

Doesn't need to create dynamic xaml page. Create three pages
1. Start Page
2. List Page
3.Detail Page
In list page use a ListBox control and bind listbox with your server data. Here and enter link description here nice explanation about listbox control

Related

Get selected item of ListBox on another page

I have made an application with two pages. When the user clicks an item on the listbox of the first page, the second page is supposed to show up with details about the clicked item.
I have a problem with accessing the selected item in the listbox of the first page from the second page.
How can I get this working?
You can't do that, because after navigation the first page no longer exists. You have to pass that value first:
How to pass values (parameters) between XAML pages?
Easiest way - to pass data by navigation parameter, it is just like GET HTTP method, Nokia has an example of how to do it here.
Second way - to store value in IsolatedStorage, for example in IsolatedStorageSettings , here Microsoft topic about it.

Windows 8 Grouped Items Page no content displayed

in my Windows 8 (Modern UI) App, i want to add a GroupedItemsPage. When I add it as my
main Page, everything Shows up, and the sample data of the template is displayed.
But when i want to add it as an additional page, that i navigate to through my MainPage,
the Content is not displayed. I only see the Title but now Elements at all.
Can anyone help me with this?
Can you provide some sample code? You might have mixed something up with the Databinding or the navigation.

Passing Parameters From Page-to-page

I have a filter that is used to populate a grid view and the url will conain: /example/grid?value1=1&value2=2
It will then have a link to page 2, which allows them to edit something.
I then want them to click a link that will send them back to the gridview under the same parameters of: /example/grid?value1=1&value2=2
Is this possible? How do I hold on and fill in the URL values so it knows how to refill the grid view accordingly??
Thank you!!
Well since you're using MVC, you should add parameters to your Grid controller that allow you to pass in parameters, then the url would look like this:
/example/grid/1/2
Then in your code you just need to read the parameters while you're filling the grid and apply the appropriate logic.

How to query the data from content type without using content query webpart in SharePoint2010.How can i?

I want to query the data from content type without using content query webpart. How could I do this?
My scenario is, I have a page layout, from the page layout I have created a page that contains some site columns values. After clicking on the save button I need to update the field in the page library column. How can I query the data in item updating event of the Site Pages Library.
Any help would be appreciated.
The ItemUpdating event method is passed an SPItemEventProperties parameter named property. This object contains information about the item responsible for firing the event handler. You can access this by calling properties.ListItem[Fieldname] or properties.AfterProperties[fieldname].
Something to note. The value of the SPItemEventProperties.BeforeProperties and SPItemEventProperties.AfterProperties as well as the properties of the SPItemEventProperties.ListItem, varies depending on the Event you are overriding and the type of SP List (List or Document Library). This chart shows these relationships.

Querystring filter for PerformancePoint

Keep in my I am using Dashboard Designer, SharePoint 2010 and PerformancePoint Server 2010.
I have a dashboard homepage showing a KPI for sales, by brand. I added a custom property "View detailed report" on my KPI. When I click on that, I want to be able to go to a second dashboard page featuring 5 scorecards and 2 reports for my sales, by brand. The brand needs to be a filter.
Obviously, what I wanted to do is to tell my second page on which brand to filter by using a querystring parameter, something like ?BrandFilter=[Brand].[X].[Y] ...
But, in Dashboard Designer, you cannot (?) have querystring based parameters. I know I can do it directly in SharePoint (with the corresponding web part), but then when I deploy my dashboard again, I lose custom changes I do to my pages.
I tried to create a custom transform for scorecards that would read the querystring and add PageFilters, but I faced two problems:
1. I cannot access the HttpContext from there (of couse!)
2. That would not do it for reports.
What should I do? Drop Dashboard Designer and work directly in SharePoint? I wish there is a solution with Dashboard Designer!
Thanks!
I found a way to do that. I customized my scorecard generation (using C#) and added a javascript method to my master page to handle all the links that are clicked. When I click on a link in a scorecard, I get the parameter from the current URL and update a filter inside the page with that. I can share more details on request...