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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.