How to detect back button -vs- GoBack() in WP7 app - windows-phone-7

Maybe I'm over-thinking this, but here's what I'm trying to accomplish.
I have two MVVM projects (assemblies) in my WP7 app. One page in the main project will call another page in the second project. The second page will allow the user to browse through a list of files on the web and select one to be downloaded to Isolated Storage. The files are rather small.
For a little background: I want two assemblies because this file-selection feature is not used often in the app and I want the Main assembly to be as small as possible to decrease startup time. I also want to be able to re-use this file-selection/download component in other apps.
The simple thing I'm trying to figure out is that when the user selects the file and it is downloaded, I will execute a GoBack() to return to the calling page. On the calling page, I need to know if, in fact, the user downloaded a file or if they cancelled out of the operation by simply hitting the back button. I thought the obvious thing might be to just check for the existence of the file in Isolated storage, but that just feel like a bit of a kludge to me.
I also thought about the Messenger, but I'm not sure how that would work across two assemblies.
Any advice would be appreciated.
Thanks

It is tough to know without looking at the code. However, I would suggest that you could pass back a value to the page depending on whether you successfully downloaded your file. Navigate with the value as follows (pass true or false depending on download success):
NavigationService.Navigate(new Uri(("/Page.xaml?download=true", UriKind.Relative));
Then evaluate the page in the destination as follows:
string download = "";
if (NavigationContext.QueryString.TryGetValue("download", out imageurl))
{
}

Related

Custom form in Outlook Task is not syncing

My partner and I created a custom task form to be used in Outlook using the developer mode to do that, and we published it to the Organization Forms Library for anyone to open. We're running into issues that I personally can't seem to find on how to resolve:
Custom forms aren't syncing correctly.
When I complete out the custom form, and I assign it to someone else they might be missing details like the dates I picked from the date picker, and text within the text box are gone too. It's very odd that sometimes some would get all the details that an end-user would input but that's like a 1/8 chance. I feel like there's a disconnect where it just won't behave like any other task. Cache mode or no cache mode doesn't matter it seems. When the person assigns it back with changes made on their end, those changes aren't seen on my side. I just have the same original details that I made when I first made it. We're on Exchange Server 2010.
Looks like a custom form was not published correctly to others in the organization. Try to create a new Outlook item on other machines with your custom forms to make sure they were deployed correctly.
Note, message forms default to separate layouts for composing and reading. Many people find their first message form doesn't look right when they receive an item created with it. That's simply because they forgot to click the Edit Read Page button and customize the Read layout!
You may find the Customizing Outlook Message Forms article helpful.

Visual Basic.NET: Saving an application?

I am a beginning programmer in VB.NET and I was wondering how to save my application when button1 is clicked, and then load my application when button2 is clicked. My application has several different forms and classes etc. Is there a simple way to save all of the different forms and the changes to those forms that the user may have made, and then load them again? If this is too complicated of a process for a beginner, then I can just forget it for now, but if anyone knows a relatively simple way to do this, I would be very grateful.
Thanks
You have a few different options. The easiest thing is probably going to be for you to take a look at the My.Settings class.

How to access unrelated browser window?

So I know this might sound crazy, as it is technically a security concern which I understand. So I'm just trying to find out if there's any ideas on how to handle something like this.
Anyways, long story short, I was told to look into figuring out a possible way to scrape information from another browser window/tab. I have been asked to do this because, and I know this sounds crazy too, but the users of our website are incompetent enough to not be able to copy/paste and or type correctly something from a different website. I know it's tough for some to have to have several things in their workflow, but this is basically what they do: Go to their first website (after logging in) and bring up a record with information on it...including an identification number. Then, the user should take that number and go to the second website, our website (after logging in), and type it that number in a textbox (and eventually do some other stuff). But we have found that getting that identification number from the first website to ours is difficult for them. Some copy/paste correctly, some copy/paste too much text from the page, some write it down on paper then type it in our website, and some just seem to have trouble visually "copying" the number from site to site.
What I was thinking was that this could happen: the user would have already brought up the record on the first site, then they would come to ours. They could click a button, and that would run whatever I/we here come up with, that goes and finds the other browser window, finds the specific text needed, and puts it in our textbox. Sounds simple, right? HA.
The first website is not owned or managed by us in any way, otherwise this might be a little easier.
A little bit of background information: unfortunately, I'm technically targeting IE >= 10 through 9, so if there's a solution just for this (why I tagged vbscript), then that's great. If there's a broader solution (like with an applet or browser extensions... http://crossrider.com/ ), then that's even better, but not important. If it helps, we already have a hidden applet on the page that accesses the OS (yes, it has the mayscript attribute on the element so it is able to), so I thought that could be something to incorporate with. Also, the way I expect to know which window/tab to access is by URL and/or document title - either will be very specific.
We cannot install stuff on the users' computers, at least something outside of the browser (like extensions). I'm not sure how browser extensions work, so I'm wondering if they'd need to be "installed".
I know of HTML5's postMessage, but it only has partial support in IE (and none in IE <= 7)...and the partial support refers to not including exactly what I might need. It also requires that the other website be listening (which we don't have control over, but technically might be possible to include). So it doesn't count :)
The things I found with Java are to possibly find the list of processes currently running, but I don't know how to access/control one. Especially how to access the browser's Document.
And vbscript...I just don't know. I don't know if it's just me, but I can't seem to find good documentation on it, so I'm not sure what can be done with it.
Even if I could get control of the other browser window, I don't know how I would get information from it (like the DOM).
I'm not looking for code, just ideas...I'll do the research. And although it may sound impossible, don't just brush it off because Javascript can't do it - I haven't.
UPDATE:
I ended up developing a browser extension with http://www.crossrider.com/ which wasn't ideal, but works.
You could use a bookmarklet for this ... the user would have to drag the bookmarklet into their bookmarks bar on their browser, but if doing that wasn't beyond your user's abilities/the technical restrictions you've mentioned, then you'd definitely be able to send the information you need back to your site that way.
You'd just need to give your users instructions to:
i) drag the bookmarklet into their bookmarks bar on their browser
ii) go to the website in question and click the bookmarklet
you could code the bookmarklet so that it would grab the info you need, and redirect the browser to your website. All done in one click.
I think you may be thinking about it in the wrong way when you talk about posting from one 'window' to another. You could write the bookmarklet so that it would do a http post of whatever information you wanted into your site from the other site, and it could also redirect the window that they were looking at when they clicked it (the other site) to your site. Or if, for some reason, you didn't want to redirect the the window that they had the 'other' site in to your site, then you could add a listener to your site so that once the bookmarklet had posted the info you require then the window with your displaying could automatically update. The first option would make more sense and be easier though.
Maybe to open the other site from button/link resided in your site using window.open() method?

back button function for phonegap windows phone 7

How do I get the back button from Windows phone to work with PhoneGap 1.2?
Now what the back button does is exit the app.
There is a good post I dont understand or get to work by one of the SO editors: http://www.scottlogic.co.uk/blog/colin/2011/11/handling-the-back-stack-in-windows-phone-7-phonegap-applications/
but I dont understand it and I cant get it to work. (even the sample .sln has an error for me)
My app is a very simple structure of index.html and many html does that come off that one page, so if all the back button did was goto index.html, that would probably work for me.
Is there a solution for idiots? For example - add this framework but only to specific pages. Put this code here, and that code there, and those pages dont need anything. Something like that?
I have recently published a more simple example for back-button handling in applications that contains simple HTML pages:
http://www.scottlogic.co.uk/blog/colin/2011/12/a-simple-multi-page-windows-phone-7-phonegap-example/
In essence, there is some C# code that keeps track of when the browser navigates from one page to another, handling the back-button event in an appropriate fashion. Just drop your code into the www directory and it should work fine.

How do I write a custom start page for VS 2008?

I've looked around, and not found much documentation on this, so I thought I'd ask where all the experts hang out.
I would like to create a new start page, with bug tracking and source control interfaces, rather than the standard MSDN feed. I seem to remember that one can do more than just supply a different URL, but can actually implement a component to run as the start page, which needn't use web content. I may be wrong. Can anyone please give me some tips?
You can do is to create a DTE ToolWindow (read: Creating a ToolWindow hosting a .NET user control) and host your controls there, then its pretty easy to create an addin that will show the tool window as a document at runtime. (The same way that the start-up page looks)
Go to Tools > Options > Environment > Startup and put your RSS URL in the Start Page news channel field.
That should give you enough, but if you want to do more you can select open home page in the at startup dropdown and point it at a URL with the appropriate content. If you use an intranet with Windows authentication you could display user specific stuff.
This will be completely customizable in VS 2010. You'll be able to do anything you want to on the start page.

Resources