I stop screen capturing on my UWP app by
ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
However, the app still shows its preview on Taskview of Windows 10
Can someone let me know how to disable the app's preview on Task view
This is the current TaskView
and this is how I need it
Capturing an app's thumbnail looks like a system behavior, and I don't know how to disable it.
But since the capture only happens when the user presses Alt+Tab or clicks the task switch button on the task bar, there is a chance to cover the app with an overlay before system takes a screen capture of the app.
First add an opaque overlay, and set its initial visibility as Collapsed.
<Grid>
<TextBlock FontSize="50" Text="Your controls here!" />
<Grid Background="Black" x:Name="overlay" Visibility="Collapsed" />
</Grid>
Then register a handler for app window's Activated event,
Window.Current.Activated += Current_Activated;
Display/Hide the overlay when window is deactivated/activated,
private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
{
if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
{
overlay.Visibility = Visibility.Visible;
}
else
{
overlay.Visibility = Visibility.Collapsed;
}
}
Related
Hi guys I have added a video to my application that plays automatically when the page loads and when the video is double tapped it goes to full screen. Here is my code.
c#
private void mediaSimple_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
mediaSimple.IsFullWindow = true;
}
xaml
<MediaElement x:Name="mediaSimple" Source="ms-appx:///Videos/1-Learning-how-to-manage-things-yourself.mpg" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AutoPlay="True" DoubleTapped="mediaSimple_DoubleTapped" />
What can I add to my code guys to allow me to exit full screen mode when I touch the screen of my device?
Modify your code like this :
mediaSimple.IsFullWindow = !mediaSimple.IsFullWindow;
I try to build a Windows 8.1 app with background audio, and when the app goes off screen the music is ok, but no SystemMediaTransportControls shows although I set it in code:
SystemMediaTransportControls smtc;
public MainPage()
{
this.InitializeComponent();
mediaElement.AudioCategory = AudioCategory.BackgroundCapableMedia;
smtc = SystemMediaTransportControls.GetForCurrentView();
smtc.IsPauseEnabled = true;
smtc.IsPlayEnabled = true;
smtc.ButtonPressed += smtc_ButtonPressed;
}
I have a computer with a standard keyboard and mouse.
you should enable them from a windows runtime component, doing a background task and enabling them in Run function enabling also background point from the manifest. Otherwise they will be killed if you navigate away from the app or frame
Hmm, that's not what I am seeing. Doing this:
<Grid Background="Black">
<MediaElement
Source="http://media.ch9.ms/ch9/f271/c9225442-2e4f-452d-ac78-f93b92eef271/DevRadioWinPhoneMultitasking_mid.mp4"
AreTransportControlsEnabled="True" />
</Grid>
The controls are visible, but they aren't visible when I navigate away from the app.
Am I missing something?
I have a textbox with a button inside (Telerik's RadTextBox with an Action configured).
When the user presses the Action, a progress bas is displayed, the screen goes dark, and some magic happens.
My problem is that since the action doesn't result in the textbox losing focus, the on-screen keyboard is not hidden, and keeps covering half the screen.
I would like to programmatically hide the on-screen keyboard, but don't know how.
Just set focus to the main page:
this.Focus();
this will focus a control that doesn't use the keyboard and thus hide the keyboard. Unfortunately there is no API to the keyboard to hide it.
Instead try disabling and then enabling the textbox in question in an appropriate place (like once a query has been submitted or an action triggered):
TextBox.IsEnabled = false;
TextBox.IsEnabled = true;
(Via https://stackoverflow.com/a/23905874/1963978)
Not clean, but it does the job (in Windows 10 mobile).
here lot solution is available for a Textblock only but in my case AutoCompleteBox
<toolkit:AutoCompleteBox Name="autoComplateTxt"
Grid.Row="4"
Margin="15,5,2,10"
Padding="0"
Height="65"
Text=""
BorderThickness="1"
BorderBrush="Black"
VerticalAlignment="Center"
DropDownClosed="autoComplateTxt_DropDownClosed"
/>
private void autoComplateTxt_DropDownClosed(object sender, RoutedPropertyChangedEventArgs<bool> e)
{
this.Focus();
}
I have a WPF application with some background tasks to be done that works perfectly on my laptop but it is not working fine in a tablet with Windows 7.
You click the screen, a loading image is shown while some background job is done, and at the end of the job a dialog with some info is shown. You press the button on the dialog and go back to the main screen.
In the tablet at the end when the dialog is shown you have to press the screen once to have the GUI "active" and then again to the application detect the click. Is like the ui thread gets "disabled" after the background task and needs the screen to be touch to be active again. It is quite annoying because the user has to press multiple times the button to get the action performed. This behaviour happens only in the tablet, not on a laptop...
Here is the code:
public void processTouch(Point p)
{
Task getPendingDocsTask = Task.Factory.StartNew(GetPendingDocs, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
Task afterGetPentingDocsTask = getPendingDocsTask.ContinueWith(w => AfterGetPendingDocs(), TaskScheduler.FromCurrentSynchronizationContext());
}
private void GetPendingDocs()
{
Thread.Sleep(500);
}
private void AfterGetPendingDocs()
{
mainprogresscircle.Visibility = System.Windows.Visibility.Hidden;
this.Background = (Brush)bc.ConvertFrom("#013857");
WindowDialog aDialog = new WindowDialog(this);
aDialog.ShowDialog();
}
In the dialog the function when click is:
private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
And the XAML of the button on the dialog
<s:SurfaceButton
Margin="-4"
BorderBrush="Transparent"
BorderThickness="0"
Width="200"
Height="75"
HorizontalAlignment="Center"
Name="OpenButton"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontFamily="Tahoma"
FontSize="20"
Content="Aceptar"
Background="#78B41E"
Foreground="White"
Click="Button_Click"
IsManipulationEnabled="True"
/>
I have tried also with BackgroundWorker and dispatcher and the behaviour is the same. Works perfectly on a regular computer but it does not response fine on a windows 7 touch device.
Any clue will be really wellcomed.
Thanks in advance,
Ivan.
I have WP7 application with several pages. When a user navigates through them it takes some time to load information. So before showing him/her the page I'd like to show “Loading…” message.
I created progress bar and placed it on the page:
<StackPanel x:Name="progressBarMain" Grid.Row="1" Grid.ColumnSpan="2" Visibility="Collapsed">
<TextBlock Text="Loading..." HorizontalAlignment="Center" VerticalAlignment="Center" />
<ProgressBar Margin="10" Height="30" IsIndeterminate="True"/>
</StackPanel>
And I'm trying to show it (and hide everything else) in the page's constructor, and hide it (and show everything else) in Page.Loaded handler.
public SomePage()
{
InitializeComponent();
Loaded +=OnSomePageLoaded;
progressBarMain.Visibility = Visibility.Visible;
ContentPanel.Visibility = Visibility.Collapsed;
}
private void OnSomePageLoaded(object sender, RoutedEventArgs e)
{
progressBarMain.Visibility = Visibility.Collapsed;
ContentPanel.Visibility = Visibility.Visible;
}
But it doesn’t' work.
Any ideas? Thank you!
Alex demonstrates showing a progress bar while the app is starting up here.
Creating a Splash Screen with a progress bar for WP7 applications. - Alex Yakhnin's Blog
Although you cannot directly manipulate the splash screen (which is static), you can display a popup (by the way, that is exactly what is done in Alex's solution) and wait for a background (read: loading) operation to complete.
Yes, you'll need to create a separate XAML Pop-up page that is loaded when the app boots up. For more details on Splash Screens, there is a code sample from MSDN:
"Code Sample for Splash Screen"