This project is read-only.

why not add a "Buy the App" button ?

Jan 30, 2012 at 5:09 AM

The review button is easy to use.  I think it's better to add a "buy" button.  If my app supports trial mode, it's easy to bring the user to the application in the Windows Phone Marketplace so that the user can buy the application.

Thanks a lot!  8-)

Jan 30, 2012 at 5:38 AM

OK...I make it myself. I can not wait, 8-) .



<Button HorizontalAlignment="Center"
                    Visibility="{Binding MainItemData.AppBuyButtonContent, Converter={StaticResource StringToVisibilityConverter}}"
                    Margin="0 15 0 0"
                    Content="{Binding MainItemData.AppBuyButtonContent}"
                    Command="{Binding ReviewCommand}" />


add this code after "public RelayCommand ReviewCommand"

public RelayCommand BuyCommand
            private set;


public AboutViewModel()

            ReviewCommand = new RelayCommand(Review);
            BuyCommand = new RelayCommand(Buy);

add this code after "private void Review()"

private void Buy()
                var task = new MarketplaceDetailTask();
            catch (Exception ex)
                MessageBox.Show("An error occurred while opening the marketplace: " + ex.Message);

add this code after "private const string AttributeUri = "Uri";"

private const string AttributeAppBuyButtonContent = "AppBuyButtonContent";


        private void LoadMainItemData(XElement itemElement)
            MainItemData = new MainItemData();

            // get data
            MainItemData.Title = GetAttributeValue(itemElement, AttributeTitle, "about");
            MainItemData.AppAuthorLabel = GetAttributeValue(itemElement, AttributeAppAuthorLabel, "by");
            MainItemData.AppPublisherLabel = GetAttributeValue(itemElement, AttributeAppPublisherLabel, "Publisher:");
            MainItemData.AppDescriptionLabel = GetAttributeValue(itemElement, AttributeAppDescriptionLabel, "Description:");
            MainItemData.AppVersionLabel = GetAttributeValue(itemElement, AttributeAppVersionLabel, "Version:");
            MainItemData.AppAdditionalNotesLabel = GetAttributeValue(itemElement, AttributeAppAdditionalNotesLabel, "Additional notes:");
            MainItemData.AppReviewButtonContent = GetAttributeValue(itemElement, AttributeAppReviewButtonContent, "Review this app!");
            MainItemData.AppBuyButtonContent = GetAttributeValue(itemElement, AttributeAppBuyButtonContent, "Buy this app!");
            // load all links
            var linkElements = itemElement.Descendants(ElementLink);
            foreach (var linkElement in linkElements)
                var link = LoadLinkData(linkElement);


add this code after "public string AppReviewButtonContent":

public string AppBuyButtonContent

It works fine.

Thanks! The source code is easy to read.

Feb 1, 2012 at 5:46 AM

Hi Yan,

thanks again for your input. I'll see if this can be added to the next release.

Some additional work may be required (e.g. a check whether the button makes sense/if the app is in trial mode), but your code still looks fine.


Feb 1, 2012 at 6:14 AM

You're right. It needs a option for the buy button. 

I hope you do better!

Thank you for your work!

Feb 9, 2012 at 10:20 AM

Sweet, I was looking for an option to add a Buy button. Nice that it's being looked into. Any idea when you might get it included in a release?

Feb 9, 2012 at 10:57 AM

I'll relese the new version with that feature and fixes this weekend.

Feb 9, 2012 at 1:47 PM

Nice, thanks.

I've been looking at using Trial mode, but I've decided to go with a free Lite app and a paid app, and I have two questions based on this use case:

Will there be a way for me to tell it to show the Buy button other that using LicenseInformation.IsTrial? I want to use the same code base, but toggle which to build using compiler directives and build configurations. It would be great if I could:

    //Enable Buy button
    //Do not show Buy button

Can I override which app it will open in Marketplace via the Buy button? Since I want this in my free lite version, I want it to go to my full version in Marketplace.

Feb 9, 2012 at 3:27 PM

Yes, it will be flexible enough to decide or override yourself when to show the button, and what app id it points to. I've just not settled on how the exact handling will look like yet.

Feb 13, 2012 at 7:30 AM

This is now part of version 1.4. Take a look at the documentation (section "Trial Mode") for details.

Feb 13, 2012 at 7:35 AM


Took a brief look at the documentation now and it looks great. Will have a look at getting it in my app later today.

Keep up the good work, it's much appreciated!

Feb 13, 2012 at 11:27 AM


Feb 14, 2012 at 3:15 PM

In the same line of thinking, it would be really cool to add a list of other apps.

Feb 16, 2012 at 10:35 PM

Hi wekempf. Something like this can easily be integrated as-is. The documentation (in particular the part on "Additional items" and "Local and remote Xaml") shows how to integrate such custom pages/user controls.

Feb 20, 2012 at 3:20 PM

Yes, I know you can extend the dialog in this manner, I just thought this would be a common enough extension to make sense to include directly within the framework.

Mar 18, 2012 at 5:51 PM

I don't agree adding it directly to the framework. The dialog pages are very flexible and should remain so IMHO. If you want a list of apps, its easy to provide a local or remote snippet of xaml for this. Force it into the framework means if I don't want it then I have something extra to remove.