Expand WP7 content element on tap - windows-phone-7

Is there any way or are there any elements in WP7 which could be expanded on tap? For example if I'm using a ItemViewModel I'd like to show only the content of LineOne and when that is tapped I want to show the content of LineTwo.
I don't necessarily need to do this with a ItemViewModel. For example the hidden content could also be buttons that appear instead of a line of text.
Any suggestions?

Have you looked into the ExpanderView from the Silverlight Toolkit? It allows you to have a tap-to-expand template and a standard template. There's a reasonable overview of it available at Windowsphonegeek

Related

Multiple controls on Xamarin button?

I would like complex button, which has several text elements and which should change their state and color depending on button state.
Unfortunately, I see that Xamarin button has only predefined image and text parameters.
How to have multiple controls inside a button in Xamarin?
Visual state manager(Only XF 3.0+) have three states: normal, disabled, focused which is named "CommonStates", or you can create custom states.Maybe it could help:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual-state-manager
I think you must read more in content view, where you can add labels into stacklayout or grid with your own api bindable property, then use it wherever you want in your code:
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.contentview

Xamarin.forms - How to display tabs on the middle of a layout

I would like to add tabs just below custom header(Grid), but I am not sure how to do that. So far I have grid and tabbedPage, but how to display both in one page? Thank you for help.
That's not possible with Xamarin.Forms - at least not out of the box, of course you can write custom renderers for something like a TabView.
Note that with X.F you are limited to very basic UIs.

WebBrowser as ListItem and scroll

This question about WP8 project.
I have a LongListSelector with pictures and html formatted text below. Currently each pictire implemented as an Item of the list. The last Item with browser has its own template and shows WebBrowser instead of picture.
I am expected this item behave such as TextBox which I can scroll by interacting with LongListSelector.
But this WebBrowser has it's own scroll inside and intercepts any surrounding scrolling events. Thus whenever I scroll down the list to show WebBrowserControl to the whole screen, I can't go back to the pictures.
Please help me with this issue. What is the appropriate solution? I need a separate pictures since want to implement "Clicked" logic on top of it. And I want to have WebBrowser too (but prefer to behave it similar to RichTextBox (which I can't find in WP8))
USE ListBox.ItemTemplate along with DataTemplate and inside dataTemplate we could custom create xaml tag !

Customizable tiles inside app

I want to display items as tiles inside my app. The HubTile control is to inflexible for me, so I use this solution with a listbox. I have a few types of items and they should be displayed differently. For example, the note item has a title and a text while the image item has a image source and a name.
Implement two styles for note and image and creating the ListBoxItem dynamically with each style seems to me as an easy way, but is it the best solution?
When you have an ItemsControl that has mutliple data types in its ItemsSource and each data type has a different DataTemplate, you should use something like DataTemplateSelector.
I've written about this topic in the context of WP7/WP8 # ListBox with multiple ItemTemplates in Windows Phone 8

Adding controls to NSTextView and binding them to (ranges of) characters

When editing code, Xcode is capabale of displaying in-text controls, like drop down buttons which can show context menu's. I've seen other OS X apps that handle text capable of similar features. See the attached sample.
I presume this effect is obtained using NSTextAttachmentCell - although I'm not sure whether this is the proper way to implement this.
For my own app I would like to use this technique as well.
I have the following questions:
Is NSTextAttachmentCell the correct way to implement such a feature? If not, what would be?
How do I attach a control -comparable to the one in the above sample- to a specific range of text so that its location within NSTextView is dynamic and follows layout actions?
I found this which gives some hints but does not cover the attachment to specific text ranges.
Although NSTextAttachmentCell will work, it has a disadvantage: the cell will become just a glyph in the text which was not what I wanted. It distorts the layout of the text, is selectable etc. I wanted the cell to be drawn over the text, just like the behaviour in Xcode.
The challenge was to find a way of translating a point from a Mouse Moved event to the position of a particular string of characters inside the NSTextView.
After some more digging I found a little gem in Apple's demo apps called LayoutManagerDemo. This demo shows a custom subclass of NSTextView capable of highlighting individual characters, words and lines while the mouse is hoovering its view. From there on it was pretty easy to fade in a button at the required NSPoint and then show a popup menu with some options.

Resources