Windows Phone 7 - Possible to Put Textbox in Application Bar? - windows-phone-7

I want to create an application bar like IE has in Windows Phone 7.1 ... it has a textbox in it instead of buttons, and it still works as the application bar with menu items under it.
Is this possible. I don't see anything under the Shell namespace, and just adding a Grid to the Application bar is not working.

No, the application bar is not derived from UIElement. So you cannot add other UIElements to it.
The closest you can get is to add a Grid along the bottom of your phone screen, color it like the application bar and add a TextBlock to it. I wouldn't recommend this approach though, because it makes your app non-standard compared to all other apps available for the platform.
If you are to go this route, you can use the PhoneChromeBrush theme resource to set the color to match the application bar.

Related

UWP: App Top Bar always shows on right click, how to prevent it?

I have an application that is already on the Windows 10 Store. It has an AppBar with items, such as File, Edit, Help.
When I right click on any control inside the app, say ListView, the AppBar shows up. Why?
I want to create context menu for ListView, but the context menu isn't showing up, because AppBar becomes focused? How can I prevent this?
Note: if I comment out AppBar in xaml, everything is working as expected.
Try changing the AppBar to CommandBar which is really similar and recommended in UWP.
XAML provides both the AppBar control and the CommandBar control. You should use the AppBar only when you are upgrading a Universal Windows 8 app that uses the AppBar, and need to minimize changes. For new apps in Windows 10, we recommend using the CommandBar control instead.
(Command bar)

How to prevent my macOS Menu Bar app from disappearing

I've been playing around with creating a Menu Bar app for macOS.
The app consists of an icon along with a title. The title displays additional context and can be dynamic width.
I've noticed that when the Menu Bar does not have enough room to display the icon AND context, it hides the whole app completely (icon and context) until there is space once again to show it.
Is it possible to prevent it from doing this somehow? Or at the very least maintain the icon visibility without the title, if room doesn't allow?
Unfortunately no, NSStatusItem lacks methods to indicate visibility or occlusion. The functionality you want might be possible via notification, but that is up to Apple to implement.
You may use two separate NSStatusItem. Looks like after creation they should be adjacent, until user reorders them with Cmd-drag.

WP7 - Text Button on the Application Bar

On Windows Phone 7, go to Settings, email & accounts, add an account, the Windows Live (or any other). Note at the bottom there is the gray panel with a rectangular [sign in] button. Click in the email address field, and the on screen keyboard pops up ABOVE the gray panel. Rotate the phone, and the gray panel does not rotate, although the page does. That gray panel is the Application Bar, is it not?
I only find docs for adding an icon-based round button (and menu items). How do we put a rectangular textual button on the Application Bar?
Adding buttons in the Application Bar is not supported for third party developers. The Application Bar itself is not a Silverlight control; it's a native one. Only OEMs, certain partners and MS have access to the native SDK, so you won't be able to template the Application Bar to have buttons. Of course, you could create your own Application Bar that mimics the real one, but I don't recommend that approach as it would be very tricky to get it exactly right and be consistent between apps.
Yes, that's the application bar. Well, it's the non Silverlight version of it. (The built in apps are not built with Silverlight.)
Unfortuanately it is not possible to use text buttons on the application bar. It's only possible to use buttons with images.
Yes it would be nice/useful in a number of situations but it's just not possible with the current SDK (even Mango). I keep hoping it'll be there in a future version...
The applications that come with the phone are not restricted to using developer APIs and the one you mention likely uses C++ and / or restricted APIs. As a third-party developer your only option is to stick with icons on the application bar.
You can always create a Panel colored like the application bar, aligned along the bottom of the screen and display buttons or whatever other UI element you want to.

Is it possible to add textBlock to windows phone 7 Applicationbar

In my ebook app, I wanted to show current page number as as textBlock on Application bar.
I couldn't find a way to add textBlock to the application bar.
Unfortunately you cannot modify the application bar itself. To build something like you'd need to create your own application bar style control.
I'm not entirely sure if this is a good thing because it would be inconsistent with the rest of the phone and could possibly violate some style guides.
You can also check this: Bindable Application Bar Extensions for Windows Phone 7

How to add an application bar to a user control in wp7

I have built a wizard style user control that lets you add stackpanel based pages and flick between them.
I would like to add an application bar as part of the user control with next and previous buttons that enable/disable based on page displayed etc.
Application bar appears to be an attached property of PhoneApplicationPage. I have tried referencing Microsoft.Phone.Shell but get invalid type.
Any ideas how I can add it to my user control?
Application bar is such a pain in the a**. This control is not a Silverlight one but a native one. Maybe you can be more lucky with this solution:
http://blog.humann.info/post/2010/08/27/How-to-have-binding-on-the-ApplicationBar.aspx
The ApplicationBar is a service that is provided by the operating system, i.e. not part of the Framework, and can only be used at the page-level, not in your UserControl. In addition, the ApplicationBar does not support regular bindings as you've seen. As mentioned above there are a number of solutions that provide workarounds for this problem.
Alternatively, you could use the ApplicationBarButtonCommand and ApplicationBarButtonNavigation behaviors from the Silverlight Windows Phone Toolkit. It's a simple enough task to create your ApplicationBarMenuCommand if you need one.

Resources