Beispiel #1
0
        private void AdvancedHeatMapProperties_Click(object sender, RoutedEventArgs e)
        {
            ConfigurableHeatMapLayer layerInfo = this.DataContext as ConfigurableHeatMapLayer;

            if (layerInfo == null)
            {
                return;
            }
            (sender as Button).IsEnabled = false;
            if (heatMapWindow == null)
            {
                heatMapWindow = new ChildWindow();
                //heatMapWindow.ResizeMode = ResizeMode.NoResize;
                TextBlock title = new TextBlock {
                    Foreground = new SolidColorBrush(Colors.White), FontSize = 12, FontWeight = FontWeights.Bold, Text = "Advanced Properties"
                };
                heatMapWindow.Title = title;
                double dialogWidth  = 325;
                double dialogHeight = 268;
                heatMapWindow.Height = dialogHeight;
                heatMapWindow.Width  = dialogWidth;

                //heatMapWindow.HorizontalOffset = (Application.Current.RootVisual.RenderSize.Width - heatMapWindow.Width) / 2;
                //heatMapWindow.VerticalOffset = (Application.Current.RootVisual.RenderSize.Height - heatMapWindow.Height) / 2;

                configWindow                = new HeatMapPropertiesConfigWindow();
                configWindow.OkClicked     += (o, args) => { heatMapWindow.DialogResult = true; };
                configWindow.CancelClicked += (o, args) =>
                {
                    heatMapWindow.DialogResult = false; // automatically calls close
                };
                configWindow.GradientStopsChanged += (o, args) =>
                {
                    //layerInfo.HeatMapInfo.Gradients = args.GradientStops;
                };

                heatMapWindow.Closed += (o, args) =>
                {
                    (sender as Button).IsEnabled = true;
                    if (heatMapWindow.DialogResult != true) // && !heatMapWindow.IsAppExit)
                    {
                        restoreHeatMapProperties();
                    }
                };
            }
            //if (layerInfo.HeatMapInfo == null)
            //    layerInfo.HeatMapInfo = new HeatMapInfo();
            //currentHeatMapInfo = layerInfo.HeatMapInfo != null ? layerInfo.HeatMapInfo.Clone() : new HeatMapInfo();

            configWindow.DataContext = layerInfo;

            //Grid g = new Grid() { Width = 310, Height = 245-20 };
            //g.Children.Add(configWindow);
            //(Application.Current.RootVisual as Grid).Children.Add(g);

            heatMapWindow.Content      = configWindow;
            heatMapWindow.DialogResult = null;
            //heatMapWindow.ShowWindow(false);
            heatMapWindow.Show();
        }
        private void AdvancedHeatMapProperties_Click(object sender, RoutedEventArgs e)
        {
            ConfigurableHeatMapLayer layerInfo = this.DataContext as ConfigurableHeatMapLayer;
            if (layerInfo == null)
                return;
            (sender as Button).IsEnabled = false;
            if (heatMapWindow == null)
            {
                heatMapWindow = new ChildWindow();
                //heatMapWindow.ResizeMode = ResizeMode.NoResize;
                TextBlock title = new TextBlock { Foreground = new SolidColorBrush(Colors.White), FontSize = 12, FontWeight = FontWeights.Bold, Text = "Advanced Properties" };
                heatMapWindow.Title = title;
                double dialogWidth = 325;
                double dialogHeight = 268;
                heatMapWindow.Height = dialogHeight;
                heatMapWindow.Width = dialogWidth;

                //heatMapWindow.HorizontalOffset = (Application.Current.RootVisual.RenderSize.Width - heatMapWindow.Width) / 2;
                //heatMapWindow.VerticalOffset = (Application.Current.RootVisual.RenderSize.Height - heatMapWindow.Height) / 2;

                configWindow = new HeatMapPropertiesConfigWindow();
                configWindow.OkClicked += (o, args) => { heatMapWindow.DialogResult = true; };
                configWindow.CancelClicked += (o, args) =>
                {
                    heatMapWindow.DialogResult = false; // automatically calls close
                };
                configWindow.GradientStopsChanged += (o, args) =>
                {
                    //layerInfo.HeatMapInfo.Gradients = args.GradientStops;
                };

                heatMapWindow.Closed += (o, args) =>
                {
                    (sender as Button).IsEnabled = true;
                    if (heatMapWindow.DialogResult != true) // && !heatMapWindow.IsAppExit)
                        restoreHeatMapProperties();
                };
            }
            //if (layerInfo.HeatMapInfo == null)
            //    layerInfo.HeatMapInfo = new HeatMapInfo();
            //currentHeatMapInfo = layerInfo.HeatMapInfo != null ? layerInfo.HeatMapInfo.Clone() : new HeatMapInfo();           

            configWindow.DataContext = layerInfo;

            //Grid g = new Grid() { Width = 310, Height = 245-20 };
            //g.Children.Add(configWindow);
            //(Application.Current.RootVisual as Grid).Children.Add(g);

            heatMapWindow.Content = configWindow;
            heatMapWindow.DialogResult = null;
            //heatMapWindow.ShowWindow(false);
            heatMapWindow.Show();
        }