/GPX.Firemap.Client/Modules/Views/AutoRefreshView.xaml.cs
C# | 80 lines | 63 code | 16 blank | 1 comment | 0 complexity | 379ae19a2f96e232d891ba5027a4e152 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- using System.ComponentModel.Composition;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Configuration;
- using Microsoft.Practices.Prism.Events;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Events;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Commands;
-
- namespace GPX.Geocortex.Views
- {
- public partial class AutoRefreshView : ChildWindow, IConfigurableView, IPartImportsSatisfiedNotification
- {
-
- [Import]
- public IEventAggregator EventAggregator { get; set; }
- private CommandRegistry cr;
-
- #region IConfigurableView Members
-
- public void InjectViewModel(object viewModel)
- {
-
- this.DataContext = (AutoRefreshViewModel)viewModel;
- }
-
- public System.Type ViewModelType
- {
- get { return typeof(AutoRefreshViewModel); }
- }
-
- #endregion
-
- #region IConfigurationInjection Members
- public string ModuleXmlConfiguration { get; set; }
- public string ViewXmlConfiguration { get; set; }
- #endregion
-
- public AutoRefreshView(CommandRegistry CommandRegistry)
- {
- InitializeComponent();
- cr = CommandRegistry;
- }
-
- public void OnImportsSatisfied()
- {
- EventAggregator.GetEvent<SiteInitializedEvent>().Subscribe(HandleEvent);
-
- }
-
- public void HandleEvent(SiteInitializedEventArgs args)
- {
- ShellCommands.BringToFront.Execute(this);
- }
-
- private void OKButton_Click(object sender, RoutedEventArgs e)
- {
- //call the custom command to apply autorefresh
- cr.GetCommand("ApplyAutoRefresh").Command.Execute(null);
-
- this.DialogResult = true;
- cr.GetCommand("ResetNavigateUI").Command.Execute(null);
- }
-
- private void CancelButton_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- cr.GetCommand("ResetNavigateUI").Command.Execute(null);
- }
- }
- }
-