コード例 #1
0
 /// <summary>
 /// Constructs the popup menu view model
 /// </summary>
 public LiteMapPopupMenuViewModel(Messenger messenger = null)
     : base(messenger)
 {
     AttachToMessenger();
     SetupMenuCommands();
     Resources = new Lite.Resources.Localization.ApplicationResources();
 }
コード例 #2
0
        /// <summary>
        /// The constructor
        /// </summary>
        /// <param name="messenger"></param>
        public LiteQueriesViewModel(Messenger messenger = null)
            : base(messenger)
        {
            Resources = new Lite.Resources.Localization.ApplicationResources();

            NewQueryViewModel = new LiteNewUserQueryViewModel(messenger);

            _newQueryViewVisibility = Visibility.Collapsed;

            SetupCommands();

            AttachToMessengerAndParameters();
        }
コード例 #3
0
        /// <summary>
        /// The query view model constructor
        /// </summary>
        internal LiteQueryViewModel(Messenger messenger, FeatureCollectionQueryDefinition query, string predicateText = null)
        {
            Resources = new Lite.Resources.Localization.ApplicationResources();

            // Set the query
            this.Query = query;

            this.Predicate = predicateText;

            // The initial functionParameters are determined by the user definitions available in the parameter definitions
            this.Parameters = new ParameterValuesViewModel(query.ParameterDefinitions);

            // Reports
            this.Reports = new ReportsViewModel(messenger)
            {
                AutoGetAvailableDefinitions = true
            };
            this.Reports.PropertyChanged += Reports_PropertyChanged;

            // Exports
            this.Exports = new ExportsViewModel(messenger)
            {
                AutoGetAvailableDefinitions   = true,
                AllowCoordinateSystemSettings = LiteClientSettingsViewModel.Instance.ExportAllowSetCS,
                AllowUnitSettings             = LiteClientSettingsViewModel.Instance.ExportAllowSetUnits,
                DefinitionsFilter             = definition => LiteClientSettingsViewModel.Instance.ExportAllowedTypes.Contains(definition.ExportType),
                ExportCoordinateSystemsFilter = cs => cs.SRId != 3785
            };

            // Get property changes
            this.Exports.PropertyChanged += Exports_PropertyChanged;

            // Set up the commands for running the query
            SetupCommands();

            this.PathGeometry = Application.Current.Resources[PathGeometryKey()] as string;

            CalculateRecipe();
        }