private void LoadWelcomeWPF() { // UI elements. Header = String.Format(Properties_Resources.Welcome, Properties_Resources.ApplicationName); Description = String.Format(Properties_Resources.Intro, Properties_Resources.ApplicationName); System.Uri resourceLocater = new System.Uri("/DataSpaceSync;component/SetupWelcomeWPF.xaml", System.UriKind.Relative); UserControl LoadXAML = Application.LoadComponent(resourceLocater) as UserControl; continue_button = LoadXAML.FindName("continue_button") as Button; cancel_button = LoadXAML.FindName("cancel_button") as Button; ContentCanvas.Children.Add(LoadXAML); // Actions. Controller.UpdateSetupContinueButtonEvent += delegate(bool enabled) { Dispatcher.BeginInvoke((Action) delegate { continue_button.IsEnabled = enabled; }); }; cancel_button.Click += delegate { Dispatcher.BeginInvoke((Action) delegate { Program.UI.StatusIcon.Dispose(); Controller.SetupPageCancelled(); }); }; continue_button.Click += delegate { Controller.SetupPageCompleted(); }; Controller.CheckSetupPage(); }
private void ShowWelcomePage() { Header = Properties_Resources.Welcome; Description = Properties_Resources.Intro; CancelButton = new NSButton() { Title = Properties_Resources.Cancel }; ContinueButton = new NSButton() { Title = Properties_Resources.Continue, Enabled = false }; ContinueButton.Activated += delegate { Controller.SetupPageCompleted(); }; CancelButton.Activated += delegate { Controller.SetupPageCancelled(); }; Buttons.Add(ContinueButton); Buttons.Add(CancelButton); Controller.CheckSetupPage(); }
private void ShowSetupPage() { Header = CmisSync.Properties_Resources.Welcome; Description = CmisSync.Properties_Resources.Intro; Add(new Label("")); // Page must have at least one element in order to show Header and Descripton Button cancel_button = new Button(cancelText); cancel_button.Clicked += delegate { Controller.SetupPageCancelled(); }; Button continue_button = new Button(continueText) { Sensitive = false }; continue_button.Clicked += delegate(object o, EventArgs args) { Controller.SetupPageCompleted(); }; AddButton(cancel_button); AddButton(continue_button); Controller.UpdateSetupContinueButtonEvent += delegate(bool button_enabled) { Application.Invoke(delegate { continue_button.Sensitive = button_enabled; }); }; Controller.CheckSetupPage(); }