diff --git a/installer/installtool/LicenseAccept.xaml b/installer/installtool/LicenseAccept.xaml index 33cef78a..674ba5ff 100644 --- a/installer/installtool/LicenseAccept.xaml +++ b/installer/installtool/LicenseAccept.xaml @@ -298,8 +298,8 @@ consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. - - + + diff --git a/installer/installtool/LicenseAccept.xaml.cs b/installer/installtool/LicenseAccept.xaml.cs index 6368d742..a5980eca 100644 --- a/installer/installtool/LicenseAccept.xaml.cs +++ b/installer/installtool/LicenseAccept.xaml.cs @@ -19,10 +19,38 @@ namespace installtool /// public partial class LicenseAccept : UserControl { + public bool Accepted { get; private set; } + + public static readonly RoutedEvent AgreementStateChangedEvent = + EventManager.RegisterRoutedEvent("AgreementStateChanged", + RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(LicenseAccept)); + public LicenseAccept() { InitializeComponent(); license_.Text = license_.Text.Replace(" ", ""); } + + public event RoutedEventHandler AgreementStateChanged + { + add { AddHandler(AgreementStateChangedEvent, value); } + remove { RemoveHandler(AgreementStateChangedEvent, value); } + } + + private void agreeOption_Checked(object sender, RoutedEventArgs e) + { + RoutedEventArgs args = new RoutedEventArgs(AgreementStateChangedEvent); + + Accepted = true; + RaiseEvent(args); + } + + private void disagreeOption_Checked(object sender, RoutedEventArgs e) + { + RoutedEventArgs args = new RoutedEventArgs(AgreementStateChangedEvent); + + Accepted = false; + RaiseEvent(args); + } } } diff --git a/installer/installtool/MainWindow.xaml.cs b/installer/installtool/MainWindow.xaml.cs index 1a727c9c..1864bea3 100644 --- a/installer/installtool/MainWindow.xaml.cs +++ b/installer/installtool/MainWindow.xaml.cs @@ -55,6 +55,7 @@ private void backButton__Click(object sender, RoutedEventArgs e) } backButton_.IsEnabled = currentPanel_ != welcomePanel_; + nextButton_.IsEnabled = currentPanel_ != licensePanel_; } private void nextButton__Click(object sender, RoutedEventArgs e) @@ -65,11 +66,18 @@ private void nextButton__Click(object sender, RoutedEventArgs e) { licensePanel_ = new LicenseAccept(); contentPanel_.Children.Add(licensePanel_); + licensePanel_.AgreementStateChanged += new RoutedEventHandler(licensePanel__AgreementStateChanged); } + nextButton_.IsEnabled = licensePanel_.Accepted; swap(licensePanel_); } backButton_.IsEnabled = true; } + + void licensePanel__AgreementStateChanged(object sender, RoutedEventArgs e) + { + nextButton_.IsEnabled = licensePanel_.Accepted; + } } }