[Windows Phone 7 Software Development] darrengladysz:
I am learning programming and trying to finish off my first WP7 application.

My day job is a corporate commercial attorney in Montreal, Quebec Canada but I like to experiment with programming as a hobby.

I was surprised that no easy mechanism was provided for an End User Licence Agreement so I drafted one using precedents.

This EULA not only protects your ip but it provides for updates, additional services and, most importantly, limitation of liability and warranty.

I want the user to be presented with the usual "I agree" button when loading the application so I set up a key in the application settings entitled licence with a bool variable that stores false if the user has not accepted the EULA and true if the user has accepted this. I then check this key on app startup to determine the page I present to the user, whether it be the EULA page or the 1st page of the application. Once the user clicks the I agree, the key is set to true and the EULA is not presented again.

On mainpage I use the following code to test if the licence was accepted (it is basic, but works):

public Classes.AppSettings appsettings = new Classes.AppSettings();

private void MainPage_Loaded(object sender, RoutedEventArgs e)

{

// Display Message box for licence

if (!appsettings.getsettings("licence"))

{

this.NavigationService.Navigate(new Uri("/EULA.xaml", UriKind.Relative));

}

}

As you can see, if licence is false, there is a navigation to the eula page.

Here is the function I use to store key in the application settings. It works for bool variables and can be re-used.

using System;

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.IO.IsolatedStorage;

namespace Car_Mileage_Tracker_2.Classes

{

public class AppSettings

{

// This class is used to store setting in application settings

// SETTINGS

// FIRSTUSE bool TRUE is not first use FALSE is first use

// LICENCE bool TRUE is licence accepted FALSE is licence not accepted

// HELP bool TRUE is help messaged displayed FALSE is help message not displayed

// UNITS bool TRUE is km and FALSE is miles

public AppSettings(){}

public bool getsettings(string key)

{

var store = IsolatedStorageSettings.ApplicationSettings;

bool value = true;

if (store.Contains(key))

{

try

{

store.TryGetValue(key, out value);

return value;

}

catch

{

MessageBox.Show("Could not retrieve setting " + key + " from Application Settings");

return false;

}

}

else { return false; }

}

public void setsettings(string key, bool value)

{

var store = IsolatedStorageSettings.ApplicationSettings;

if (store.Contains(key))

{

try { store[key] = value; }

catch

{

MessageBox.Show("Could not save " + key + " setting in Application Settings");

}

}

else { store.Add(key, value); }

}

}

}

I have attached the EULA xaml page as well as the EULA cs page and a word document containing my sample EULA. To circumvent upload restrictions I have added txt to the xaml and cs files, you simply need to rename them. You will need to fill in the info for your company and edit section 13 to provide for your local court district and state/province/country. Also, I have not yet implemented the code for clicking on the I disagree button. This seems to be a touchy issue in WP7 Silverlight as there is no way to cause an application to terminate except by raising an exception which may be against marketplace rules. I probably will show another page explaining to the user that he/she cannot use the application without agreeing to the EULA but I am not there yet

I feel that this EULA affords me sufficient protection as a developer of an application but make no warranties to this effect and it is always recommended to have it verified by your lawyer.

I hope this may be of use to some of you developing apps.

If you have comments or suggestions, let me know or send me a pm. If you appreciate and use this, then you can, but are not obligated to send me some coffee money or a copy of your app :)

I will eventually translate the EULA in French, but if would be great if we could get a Spanish, Italian and German version of this.

Have fun.

Message to thread Moderator: If this is not posted in the proper thread/forum, please feel free to move it to the correct one.