Inconsistent default button behavior in WP8.1 Universal versus Silverlight 8.1 / Windows 8.1 / earlier - windows-phone-8

Why is the default button visual behavior on click different in Windows Phone 8.1 "universal" apps? Is there some way to restore it to the behavior consistent with all other versions of Windows Phone/Windows 8 or do I need to create a new custom control?
Windows Phone 7/8/8.1 Silverlight/Windows 8.1: Button background flashes a complementary color based on theme, button stays fixed.
Windows Phone 8.1 "universal": Button background doesn't change color, tilt effect is applied to the button displacing it based on where the user has touched it.
I'm a beginner developer with some experience in developing WP7/WP8 apps, trying to make my first universal app for WP8.1/Windows 8.1. I verified this behavior in VS2013 Update 2 RC with a new Windows Store App, new WP8.1 Silverlight app, new WP8.1 universal app and one of my existing WP8 apps by just creating a new button object in xaml. Appreciate any help!

In my own test, the button does change color to the PhoneAccentBrush resource.
But if you want to remove the tilt effect, you should just edit the style of the button. Since you claim to be a beginner, I'll explain how to easily change the style using VS2013. Maybe you don't know this yet.
Right-click your Button in the designer, goto Edit Template... on the menu, then select Edit a Copy...
This will generate the standard button style in your xaml which you can edit. FYI, this will change your document outline to the button style outline. (See Document Outline window in VS2013.) To go back to the page outline, click the up arrow icon at the top of the outline.
Anyways, find the < VisualState x:Name="Pressed"/ > line and then comment out the PointerDownThemeAnimation line.
Done!

Related

Styling Windows Phone 8.1/WinRT AppBarButton

I'm currently looking to implement a CommandBar for a WinRT Windows Phone 8.1 app. Overall it is very straightforward but I am unable to style the control.
I have themed my app so that the accent colour has been changed to green. This works well for pretty much everywhere in the app (buttons, textblocks etc.) but not for the AppBarButton.
The brushes I'm overriding are SystemColorControlAccentBrush and PhoneAccentBrush but changing these does not make any difference to the colour of the AppBarButton when pressed:
Any idea what I'm doing wrong/can this colour be changed?
Set the CommandBar's foreground and background colors.
The command bar on Windows Phone is system UI not app UI and does not allow customizing the colors of individual AppBarButtons. Their colors always come from the CommandBar's colors.
try changing app bar button color
<AppBarButton x:Uid="SendMessageButton" Icon="Send" Foreground="" Background="" Command="{Binding SendMessageCommand}" IsEnabled="{Binding IsSendMessageButtonEnabled}"/>
or change in code behind
AppBarButton app = new AppBarButton();
app.Foreground="";
app.Background="";

Bringing up the soft keyboard in a Windows Phone 8.1 Direct3D app

I'm porting a game to Windows Phone 8.1 using C++/CX with DirectX 11. I need to bring up the soft keyboard for some text input.
Under Windows phone 8, I used the code provided by Microsoft here:
How to handle keyboard input in a Direct3D app for Windows Phone 8
This worked well but none of this code is valid in Windows Phone 8.1 and I've been unable to find any updated information. How can I do this in 8.1?
I need to show/hide the keyboard and listen for keyboard inputs. Popping up a dialog box with a text input element would also be acceptable.
The easy ways:
(on phone, but not desktop) call InputPane.TryShow and TryHide to
explicitly open the input pane out of context from an actual control. You can catch the input in the CoreWindow.CharacterReceived event.
(on either) use a Xaml TextBox on top of your DirectX surface via Xaml DirectX Interop. This
has the advantage of being easy as the Xaml controls already
implement the accessibility and IME interfaces needed for full text
support. It has the disadvantage of being external to the DX scene so
it can require some care to place it nicely.
I generally try to do
the full interactive form in Xaml rather than trying to merge a
single TextBox into a scene. Putting the controls in a Xaml popup like you mention should work nicely.
The hard way:
Implement your own fully functional control by providing the UI Automation text patterns and Text Service Framework (TSF) interfaces. Internally this is what the Xaml text controls do so that they appear to the system as text. When the user sets the focus to a text control (that supports the text patterns) the keyboard will automatically open.

Windows Phone 8.0 control app image when in background

Is there a way to control what the WP8.0 app screen looks like when in background task. I mean when cycling over the apps after a long press on back button ?
I'm using a custom Prism, and I tried to set a different background from OnNavigatedFrom but it seems that the page is already unbound at this moment because this has no effect on the page.

How to set text on the secondary tile in Windows Phone 8.1 Universal App

I want to show a text across the middle of the secondary live tile (not the small text at the bottom). I am struggling to find any documenttion of how to do it. I know it was possible in WP 8, but I wonder if this functionality is still available?! I also want to it from code not from XAML.
Are you familiar with the tile template catalog for Windows Runtime apps?
http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx

How to force windows 8 touch keyboard to be displayed on the app screen in a winjs application?

Am working on a windows store winjs application and am trying to force display the touch keyboard on the application screen.
I couldn't find any proper solution over the net for the same.
Is there a way to force display it?(would be great if there are some work arounds)
The touch keyboard show & hide behavior is designed to be controlled by the user and should not be changed easily.
Anyway an easy workaround is to set the focus on an input control in the page programmatically. This will make the keyboard appear, but the the control will be back to the user and he will be able to hide it at any time.
Cheack this article for a more complex workaround if you need a bit more control: How do I hide virtual keyboard for select element in Win8 JavaScript app?