EbaySearchView Page

When the viewmodel is created within the view, it receives a Func that allows it to resolve the EbayClient (see Listing 27.7).

The view contains a TextBox to allow the user to enter a search query.

The view subscribes to the KeyUp event of the TextBox, which allows the app to detect when the user taps the Enter key on the Software Input Panel (SIP) and to execute the viewmodel object’s SearchCommand.

LISTING 27.7. EbaySearchView Class

public partial class EbaySearchView : PhoneApplicationPage{    public EbaySearchView()    {        InitializeComponent();        DataContext = new EbaySearchViewModel(            () => new EbayClient(), new NetworkConnectionMonitor());    }    EbaySearchViewModel ...

Get Windows® Phone 8 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.