How to get any info when you click on TreeViewItem? - treeview

I have a problem with TreeView item in WPF. I need realize MVVM pattern.
How can I do some actions when I click on any tree element without using events?
For example, when I click on a TreeViewItem, I want add a text into a TextBlock element.

Related

Kendo Grid keyboard navigation

Lets say I have a list of 1000 items and I am trying to navigate through the grid using keyboard arrows UP/DOWN.When I reach the last item on the page the keyboard DOWN arrow doesn't load the next items in the grid. This is the code.
Thanks

How to Animate Items being Added to a ListBox

In extension of the first question I asked here How to Scroll to the Bottom of a ListBox when Items are Added where I discovered how to scroll a ListBox to the most recently added item, I'd like to be able to take this one step further and add in some sort of slide in animation to newly added items. How might this be possible? Any starting points would be of great help.
I use Telerik's DataBoundListBox, it supports add/remove animations in a easy declarative way.

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 !

Is it possible to remove and move a row of listbox on itself?

Just like the UITableView on iphone.
users can remove or move a row on UITableView.
There is only one button to switch the UITableView to editing mode.
but for listbox on wp7 , I need 3 buttons, one for removing the selected row, one for moving the row up, one for moving the row down.
Welcome any comment
The Windows Phone ListBox doesn't support these features out of the box, but it would be possible to add them yourself using a DataTemplate.
Here's a blog post about creating a custom DataTemplate for your ListItems.
At a high level, you'll need to create a template that contains:
Enter edit mode button
Delete button
Sort up/down buttons
Then in your code, you'll need to toggle the visibility of the delete and sort buttons, as well as handle user clicks on each of the buttons. Doable, but a fair amount of work.
In my opinion, a better option would be to use a approach that's different from what you might be used to but is more familiar to Windows Phone users: the ContextMenu. This control allows you to pop up a menu when the user performs a long touch (tap-and-hold) on an item.
Here's a good tutorial about incorporating this control into your app.
Take a look at re-order ListBox here. It shows how to retemplate the ListBox.
For removing on item, you just need to remove its data source item. See how to use ObservableCollection.
If you want to show effect when an item is removed, use Event Triggers for the Unloaded event.

How do I build a toolbar in my title bar?

I have to implement a custom toolbar for my application, where a button will be placed on the side of exit, maximize and minimize buttons.
I tried to work with the toolbar element on XCode, but it always put elements below these buttons and not on the side.
App Store application implement this feature, like you can see in this image.
One solution is to start with this open source code (https://github.com/indragiek/INAppStoreWindow) to give you the correct title bar style, and then position buttons in the titlebar.

Resources