The SettingsFlyout can not be displayed in Windows Phone 10 - xaml

I created a custom SettingsFlyout. The SettingsFlyout appears properly when it runs in my Desktop. But when I run it on a mobile device, the SettingsFlyout does not appear. Here is the code:
private void SettingsButton_Click(object sender, RoutedEventArgs e)
{
var flyout = new TestSettingsFlyout();
flyout.Show();
}

The remarks at MSDN stands:
Caution SettingsFlyout is not supported for use in UWP apps for Windows 10.
Caution SettingsFlyout is supported only for use with the SettingsPane in Windows 8. While the SettingsFlyout type is visible in Windows Phone projects, SettingsPane is not present on Windows Phone, so use of SettingsFlyout is not supported.
Therefore this may be the problem.

Related

Getting dll error while adding foreground color to a textblock in Windows Phone 8.1 App

I am trying to add foreground color to a textblock in Windows Phone 8.1 App. For this, I have added a reference to dll "System.Drawing".
The error ("Cannot find type System.MarshalByRefObject in module mscorlib.dll.") is shown for this line while building the solution
txtBlock.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(100,200,100,200));
and for this as well
txtSubject.Foreground = new SolidColorBrush(Windows.UI.Colors.Beige);
Remove the System.Drawing" reference, it is not compatible with Windows Phone 8.1 and you do not need it.
Try to create the brush on the UI thread by using a Dispatcher.

How can I place a button on the title bar?

I am attempting to make a button that shows a user-menu, as seen in Google Chrome:
There's no legacy way of doing this, so I've had a look around and I have found that every way of doing this is either outdated or does not work (probably because it's outdated!).
This is the first link I found, but however it only works with Windows Aero off, and probably not with Windows 8, 8.1, or 10, and not very well. The answer to this Stack Overflow question is also essentially the same code:
Aero on:
I have also found some questions here, but the techniques mentioned do not work. One of the answers points to this MSDN article which appears to offer some of the functionality I want, but the code however is c++.
Is this possible in VB.NET without any issues, and if so, how?
This is with VB.NET and Windows Forms, target operating systems are Windows 7 and newer.
Take a look at these 2 links:
Adding caption buttons to the Non-client area on Vista
.Net ActiveButtons Library
It's been a while since I've used VB.Net, so if you don't mind I'll just add a c# code example (basically I took the example from the first link and tried it, it seems to be working fine)
private void Form1_Load(object sender, EventArgs e)
{
IActiveMenu menu = ActiveMenu.GetInstance(this);
ActiveButton button = new ActiveButton();
button.BackColor = Color.LightBlue;
button.Text = "One";
button.Click += button_Click;
menu.Items.Add(button);
}
private void button_Click(object sender, EventArgs e)
{
MessageBox.Show("Button clicked");
}
Note: This button doesn't seem to support transparent background, so it doesn't look quite as good as the button in chrome.

Code for custom taskbar hover-over buttons?

Windows Vista, 7 and 8 all display a preview of the application; when the application icon of an open application is hovered over in the taskbar.
Some developers have added custom options in this tooltip, like Windows Media Player:
Given an application written in C++ which uses the Windows Template Library, how would I code in a custom button to an application tooltip preview?
The feature is known as Taskbar Extensions - Thumbnail Toolbars. WTL does not provide any helper/wrapper classes to implement support for thumbnail toolbars, so you have to use the API directly, using ITaskbarList3 interface.

Is there a way to see if a physical keyboard is attached to a Windows 8 device?

I'm writing a Windows 8 game. The game runs on Windows 7, Windows Phone, and XBox.
I want to display keyboard hints if a keyboard is attached (e.g. 'Press Esc to exit')
Seeing as Windows 8 can be a desktop, laptop, or tablet, there may or may not be a physical keyboard attached. Is there a way to determine this programmatically?
Of course,
please read this quick start here
private void GetKeyboardProperties()
{
KeyboardCapabilities keyboardCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
KeyboardPresent.Text = keyboardCapabilities.KeyboardPresent != 0 ? "Yes" : "No";
}
or if you html5/js developer take a look here.

Silverlight printing in web browser problem

I'm trying to print from a Silverlight application.
Printing works when I run the application Out Of Browser. But when I run it in the web browser, the Print dialog is shown but nothing happens when I click the buttons (Print, Cancel, or even close the window). I tried running without debugger attached (deployed to IIS) but it's the same thing.
The code:
private void PrintLabel()
{
PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += new EventHandler<PrintPageEventArgs>(printDocument_PrintPage);
printDocument.Print("Label for " + this.tbSerialNo.Text);
}
void printDocument_PrintPage(object sender, PrintPageEventArgs e)
{
e.PageVisual = this.csLabel;
}
Am I missing something?
This sounds like a browser-specific issue I have seen in the past. Are you running this in Firefox 3.6 or later? If so, this Firefox bug might be of some interest to you since the print dialog is a popup window as well.
You can fix this popup issue by setting dom.ipc.plugins.enabled to false in Firefox's about:settings menu. However, this sometimes causes mouse oddities, as described here.
If this is the case(and it sounds like it is), printing does work in Out-Of-Browser mode since its really just running Silverlight in an IE process without any toolbars.