Windows Phone Store - its possible to disable application switcher screen screenshot - windows-store-apps

I have disabled the functionality to take a screenshot from my app using:
ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
But I would like to hide all the content before the application is suspended/sent to background so the thumbnail appearing in the recent apps or application switcher screen does not show any confidential information.
Have tried to hide content on the onSuspend and Visibility_Changed events, but i think the sceenshot is taken just the moment the user press the Home Button (the one with the Windows logo).
Do you know any way of disabling that feature?

Subscribing to the WindowActivated event might be worth a try. The name is misleading as it will be launched on (any kind of) deactivation as well; which is what you want. I use it to save information on exit scenarios such as Home Button press but have not tested whether you could do a quick redraw or not.
Protected Overrides Async Sub OnLaunched(e As LaunchActivatedEventArgs)
''Stuff
AddHandler Window.Current.Activated, AddressOf WindowActivated
''Stuff
End Sub
Private Sub WindowActivated(sender As Object, e As Windows.UI.Core.WindowActivatedEventArgs)
If e.WindowActivationState = Windows.UI.Core.CoreWindowActivationState.Deactivated Then
''Hide your confidential visuals here
End If
End Sub

Related

Minimize Access Application then Maximize it and set focus back to Access Application

I need to do what i describe in Title but when the minimizing with DoCmd.Minimize seems to work as the access window disappears. But then when i try to maximize it back with DoCmd.Maximize, it doesn't give focus back to access window.
PS : i use theses methods in a function called by a acDialog form.
Did you try setting focus on your control/form?
DoCmd.Maximize
Form_MyForm!MyControl.SetFocus

Detect volume and home button presses on the Siri Remote

It's relatively straightforward to detect some button presses on the tvOS Siri Remote: the pause/play button, the touchpad area, and with marginally more effort, the MENU button. But there seems to be no way detect or override the function of the + and - buttons, or the Siri or home buttons.
Or is there?
Currently the + and - (volume) buttons on the Siri remote are accessed through private functions. These can't be overwritten or detected, as they have a reserved function. The same goes for the home button.
There are a couple of points that support this claim. First, as the OP noted, there are no events that detect any actions related to the volume buttons. They don't trigger the pressesBegan or similar events either.
Another good place to look for more options with the remote/controller is GCGameController. It looks like it has functionality related to all, but the volume buttons, which are reserved. Take a look at the
Using the Apple TV Remote as a Game Controller section here. It mentions all of the buttons on the remote that can be used in a CGGameController.
As I mention in my other posts, this is a fairly new OS and not everything is available yet. You can always file a bug report with Apple and request certain API to be made public.

asp:button reloads the page instead of firing OnClick event in Sitecore

I am using Sitecore and I have a header sublayout that I use in all pages. This layout contains a Logout button that fires OnClick event when clicked and executes the onclick event function. But in few pages it wont fire OnClick event at all instead it reloads the page.
Below is the code for the logout button
<asp:button id="btnLogout" runat="server" borderstyle="None" onclick="btnLogout_Click" text="Log out" ToolTip="Log out" backcolor="Transparent" style="cursor:pointer" class="logout_new"></asp:button>
Below is the code for the event function
protected void btnLogout_Click(object sender, EventArgs e)
{
Sitecore.Security.Authentication.AuthenticationManager.Logout();
Response.Redirect("/Login.aspx");
}
I found out that the difference between the pages where the logout fires the onclick event and pages where it does'nt is that they use the same header sublayout containing the logout button but they use different content sublayout though.
Note: I have not applied Cache to any sublayout.
Can anyone help me with this?
From the given context I don’t know what is the issue but here is what I will do if I have issue like this.
As you said only on few pages it is not working, it could be the other controls on that particular page is causing the issue.
I will pick two pages which has less controls on the presentation layer. Say PageA is a working page and PageB is a non-working page. Then I compare PageA and PageB and remove all common controls, this should narrow down the number of the controls on the presentation layer. Now check again to see if Page B is working or not. If not, I will try to remove one control at a time on PageB untill it starts working. If you find by removing certain control and the page started working then you can look into the particular control and identify the issue.
I hope this helps.
try disabling the cache as it would return the html without triggering the back end code.
To do so, one option is going to the presentation detail of those pages, find the control and click on it to edit. Under the "Caching section" uncheck "Cacheable" and publish the item. If this fixes your problem, I'd review the standard values of the template, to apply the change to all the items with the same template
This behavior happens to me at annoying times too, but it's almost always the same thing: the Sitecore sublayout the code is in is being cached.
The onclick javascript fires, but the page is not re-rendered with new content because the "unclicked" version is stored in the cache.
You'll need to disable caching on the sublayout to make the button work.
This can, however, be somewhat annoying if you're trying to cache as much presentation stuff as you can. In those cases, it often means you need to, counter-intuitively, create a number of "sub-sublayouts" and place them statically. Set the containing sublayout to be uncached, and then you can set each smaller one's caching appropriately (caching static parts, not caching dynamic stuff).
The problem was in the content sublayout in which it was not working, the Page_Load function was calling a Response.Redirect function to itself and it was not checking if it was a post back request or not before that. So Whenever a user clicked logout button it used to post it back to the server and the page used to reload instead of executing the onclick event.
I noticed that in the other content sublayout where it was working, it was checking if it was a post back or not.
I added a if(!IsPostBack) before that and it started working.

Adobe AIR bring to front

I have an adobe AIR app. When I send some data with a local connection from a web page, I want the app in front of the browser and all the other windows.
I tried with both activate() and orderToFront() but I have no results.
The only script working is:
window.alwaysInFront=true;
window.alwaysInFront=false;
But this doesn't give the focus to the app. So when I click the button on the browser, I have the app on the top, but if I click on the browser the app stays on top until I click on it (giving it the focus) and than I click on the browser window again. It works fine If I click on the browser top bar.
I think that activate() would solve the problem giving the focus to the app, but doesn't work.
Here it is the code (I worked with the native window to resize, minimize and maximize the window too). The function I call from local connection is "primopiano"
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display.MovieClip;
import flash.display.NativeWindow;
var window = stage.nativeWindow;
function trascina (event:MouseEvent) {
window.startMove();
}
...
function primoPiano (event) {
trace("porto in primo piano...");
//window.activate(); // doesn't work
//window.orderToFront(); // doesn't work
window.alwaysInFront=true;
window.alwaysInFront=false;
}
Did I forgot to import something or do I have to define a different window to do this?
Thanks!
Nadia
Have a look at the Documentation and API Reference
AIR provides several methods for directly changing the display order of windows. You can move a window to the front of the display order or to the back; you can move a window above another window or behind it. At the same time, the user can reorder windows by activating them.
You can keep a window in front of other windows by setting its alwaysInFront property to true. If more than one window has this setting, then the display order of these windows is sorted among each other, but they are always sorted above windows which have alwaysInFront set to false. Windows in the top-most group are also displayed above windows in other applications, even when the AIR application is not active. Because this behavior can be disruptive to a user, setting alwaysInFront to true should only be done when necessary and appropriate. Examples of justified uses include:
Temporary pop-up windows for controls such as tool tips, pop-up lists, custom menus, or combo boxes. Because these windows should close when they lose focus, the annoyance of blocking a user from viewing another window can be avoided.
Extremely urgent error messages and alerts. When an irrevocable change may occur if the user does not respond in a timely manner, it may be justified to push an alert window to the forefront. However, most errors and alerts can be handled in the normal window display order.
Short-lived toast-style windows.
Note: AIR does not enforce proper use of the alwaysInFront property. However, if your application disrupts a user’s workflow, it is likely to be consigned to that same user’s trash can.
I have tried:
window.alwaysInFront = true;
window.alwaysInFront = false;
window.activate();
You could also try with a reference to a display object on the window stage:
displayObject.stage.nativeWindow.alwaysInFront=true;
//(where displayObject is your instance name)
And works fine. I'm using Adobe AIR 4

How to navigate within settings flyout in Windows 8.1 Store app?

I am working on my first Win 8.1 Store app and have some trouble understanding the SettingsFlyout.
Thanky to the docs creating Flyouts for my custom settings and adding them to the Settings Charm is not a problem.
However I have not been able to find out how navigate within the Flyout. I would like to create the following behavior as it can be seen in the Mail App:
Swipe from the right to show charms
Click on "Settings" to show the settings pane
Click on Account to show the "Accounts List Flyout"
On the "Accounts List Flyout" click on an account show its settings
The settings of the selected account are shown within the Flyout
Using the Back button brings you back to the accounts list
Steps 1-3 are no problem. But how do I manage the other steps? How can I navigate one lever deeper into the settings and use the Back button to go up again?
For Step 5 you can do something like
var newFlyout = new AccountFlyout(id);
newFlyout.ShowIndependent();
Now you are done with Step 5.
In the AccountFlyout.xaml.cs file hook on the BackClick event (in constructor) and then do something like:
void OnAccountFlyoutBackClick(object sender, BackClickEventArgs e)
{
// go back to the accounts list
var listFlyout = new AccountsListFlyout();
listFlyout.Show();
}
Clicking the Back button being on an Account will now go 'back' to the Accounts List flyout.
Yes, this is not very 'MVVM' friendly (if you perform the navigation in the VM you must know about the Flyouts and if you do it in the 'code-behind' you are not 100% MVVM conform) but it gets the job done without creating unnecessary complexity :)