private void AdvancedClusterProperties_Click(object sender, RoutedEventArgs e) { GraphicsLayer layerInfo = DataContext as GraphicsLayer; if (layerInfo == null) { return; } FlareClusterer flareCluster = layerInfo.Clusterer as FlareClusterer; if (flareCluster == null) { return; } ChildWindow fw = new ChildWindow(); //fw.ResizeMode = ResizeMode.NoResize; TextBlock title = new TextBlock { Foreground = new SolidColorBrush(Colors.White), FontSize = 12, FontWeight = FontWeights.Bold, Text = "Advanced Cluster Properties" }; fw.Title = title; fw.Height = 235; fw.Width = 290; currentClusterInfo = flareCluster; // TODO nik (refactor) flareCluster. flareClusterer..ClusterInfo != null ? layerInfo.ClusterInfo.Clone() : new ClusterInfo(); ClusterPropertiesConfigWindow configWindow = new ClusterPropertiesConfigWindow(); configWindow.OkClicked += (o, args) => { fw.DialogResult = true; }; configWindow.CancelClicked += (o, args) => { fw.DialogResult = false; // automatically calls close }; fw.Closed += (o, args) => { if (fw.DialogResult != true) // && !fw.IsAppExit) { restoreClusterProperties(); } }; configWindow.DataContext = flareCluster; fw.Content = configWindow; fw.DialogResult = null; //fw.ShowDialog(); fw.Show(); }
private void AdvancedClusterProperties_Click(object sender, RoutedEventArgs e) { GraphicsLayer layerInfo = DataContext as GraphicsLayer; if (layerInfo == null) return; FlareClusterer flareCluster = layerInfo.Clusterer as FlareClusterer; if (flareCluster == null) return; ChildWindow fw = new ChildWindow(); //fw.ResizeMode = ResizeMode.NoResize; TextBlock title = new TextBlock { Foreground = new SolidColorBrush(Colors.White), FontSize = 12, FontWeight = FontWeights.Bold, Text = "Advanced Cluster Properties" }; fw.Title = title; fw.Height = 235; fw.Width = 290; currentClusterInfo = flareCluster; // TODO nik (refactor) flareCluster. flareClusterer..ClusterInfo != null ? layerInfo.ClusterInfo.Clone() : new ClusterInfo(); ClusterPropertiesConfigWindow configWindow = new ClusterPropertiesConfigWindow(); configWindow.OkClicked += (o, args) => { fw.DialogResult = true; }; configWindow.CancelClicked += (o, args) => { fw.DialogResult = false; // automatically calls close }; fw.Closed += (o, args) => { if (fw.DialogResult != true) // && !fw.IsAppExit) restoreClusterProperties(); }; configWindow.DataContext = flareCluster; fw.Content = configWindow; fw.DialogResult = null; //fw.ShowDialog(); fw.Show(); }