コード例 #1
0
        /// <summary>
        /// Sets the main document to which this control belongs.
        /// </summary>
        /// <param name="host">The host.</param>
        public void SetHost(OSMDocument host)
        {
            this._host             = host;
            this.RenderTransform   = this._host.RenderTransformation;
            this._stroke_thickness = UnitConversion.Convert(0.1d, Length_Unit_Types.FEET, this._host.BIM_To_OSM.UnitType);
            this._host.Menues.Items.Insert(5, this._eventMenu);
            this._host._createNewSpatialDataField.Items.Add(this._generateData);

            var     bindConvector = new ValueToBoolConverter();
            Binding bind          = new Binding("VisualEventSettings");

            bind.Source    = this._host;
            bind.Converter = bindConvector;
            bind.Mode      = BindingMode.OneWay;
            this._reportVisibilityDetails.SetBinding(MenuItem.IsEnabledProperty, bind);
        }
        /// <summary>
        /// Sets the host.
        /// </summary>
        /// <param name="host">The main document to which this control belongs.</param>
        public void SetHost(OSMDocument host)
        {
            this._host           = host;
            this.RenderTransform = this._host.RenderTransformation;
            this._host.OptionalScenarios.Items.Insert(2, this._captureEventMenu);
            this._host.OptionalScenarios.Items.Insert(2, this._getWalkingTrailDataMenu);
            this._host.OptionalScenarios.Items.Insert(2, this._animation_Menu);
            this._host.OptionalScenarios.Items.Add(this._trainingMenu);
            var     bindConvector = new ValueToBoolConverter();
            Binding bind          = new Binding("FreeNavigationAgentCharacter");

            bind.Source    = this._host;
            bind.Converter = bindConvector;
            bind.Mode      = BindingMode.OneWay;
            this._captureEventMenu.SetBinding(MenuItem.IsEnabledProperty, bind);
            this._getWalkingTrailDataMenu.SetBinding(MenuItem.IsEnabledProperty, bind);
            Binding animation = new Binding("AgentScapeRoutes");

            animation.Source    = this._host;
            animation.Converter = bindConvector;
            animation.Mode      = BindingMode.OneWay;
            this._animation_Menu.SetBinding(MenuItem.IsEnabledProperty, animation);
            this._trainingMenu.SetBinding(MenuItem.IsEnabledProperty, animation);
        }