I need to have a toogle button in AppBar inside my WP7 app. But I see nothing except ApplicationBarIconButton.
Is it possible to have a toggle button in AppBar or make ApplicationBarIconButton to act as a toggle button?
no toggle button is not possible in the app bar. you can use application bar icon button and change the image depending upon user action
Related
Usually when running a UWP app on Xbox the B button on the controller is handled automatically and will return you to the previous page.
I have a page which contains a WebView, when you use the directional buttons to place the focus box around that control, the B button no longer responds. You can use the A button to take control of the WebView and display the pointer and the B button then will return focus back as above but I cannot navigate back using the B button until you move the focus box to a different control. This also happens using AdControl since this uses WebView.
I have tried to capture KeyDown:
Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
private void CoreWindow_KeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs args)
{
Debug.WriteLine(args.VirtualKey.ToString());
}
This responds with GamePadB, GamePadX etc but not when the focus box is around the WebView.
Is there anyway I can find out when the GamePad buttons (specifically B) are pressed when the focus box is around the WebView (or AdControl) and the control isn't engaged so I can manually invoke the backstack navigation?
Since this issue happens when using the XY focus mode for the app, if your OS version is 14393 or higher, one workaround for this issue is to use the mouse mode for this page which contains the webview by setting RequiresPointer="WhenFocused" as following:
<Page RequiresPointer="WhenFocused">
...
</Page>
And set another page to XY focus mode by using the following code in the app.xaml.cs:
this.RequiresPointerMode =
Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
For more information, please try to refer to the following article:
https://msdn.microsoft.com/en-us/windows/uwp/input-and-devices/designing-for-tv#mouse-mode
I try to Designate the Accept Button property from my form to the click event of a label. If I would have used a button this wouldn't have been a problem but I have chosen to use a label for UI reasons.
Unfortunaly the Accept Button property only accept a button, so I have already tried to place a button on my form, make this button the acceptbutton and call the label_Click method when the button click_event is fired.
This worked like a charm but when I made the visibility property of my button false or made my button Hide() after the InitializeComponent() the Accept Button didn't worked anymore.
How Can the Accept Button property accept a label OR how can I visually hide a button without changing its visibility property?
Edit: a visualisation of what I tried to acomplish.
When the enter is pressed on the form (Accept Button property), I want to invoke the same method when the Play label is clicked.
To make the button "disappear" without hiding it you can change the border to 0, change the background color to the same color as the form and for FlatStyle property choose Flat. You could also use an image for the button background that is the same color as your form.
I made a customized control that is a picturebox and a button. When the user clicks on the button, i want to show a form that will capture the webcam image and put on the picturebox of the customized control. But i can access outside the control, the button click. I can access the control click but not only the button click...anyone can help me?
thanks!
Rafael
In your control's constructor after the InitializeComponent() (if you have it), write
this.myButtonName.Click += (press Tab twice)
and the handler will automatically be created for you.
How can I keep a Button control in the pressed state in a windows phone 7 app using C#? I want to have many different buttons on the screen, but when I press any of them I want it to stay pressed. Any ideas?
Also, once it is in its pressed state, is there a way to "depress" it manually?
Thanks
If the button properties are as follows:
foreground: white
background:black
Then in the pressing state its properties will be
foreground: black
background:white
If you change the properties of button in click event it can be seen as it is pressed. And making the IsEnabled property of button prevents it from firing the events on buttons.
I have a TabbedView with multiple Panels
on each Panel I have a button for edit/save/cancel
i need to freeze all other Panels when I am editing one of them
I have an event on Edit Button and can read all Panels in TabbedView and make
dockPanel1.Enabled = false;
the problem is when they are on same panelContainer like in the image
i would like to freeze the other Tabs
with Enabled = false the Panel is disabled but the user can click on Tab, and I want to restrict him to view other panels
any suggestion is welcome
You would have to disable each control within each of the tab, this would probably be best handled on the click event of the tab.
Just spin through the tabView.controls object and set each control enabled or disabled based on whether you want them enabled or disabled.