小编use*_*964的帖子

WPF获取父窗口

HY,

在我的MainWindow.xaml.cs文件中,我创建了一个getter来获取对我的列表框的引用.

public ListBox LoggerList
{
    get { return Logger; }
}    
Run Code Online (Sandbox Code Playgroud)

现在我想从普通类访问LoggerList但我不工作.我尝试了以下方法:

MainWindow parentWindow = Window.GetWindow(this) as MainWindow;
object selectedItem = parentWindow.LoggerList;
Run Code Online (Sandbox Code Playgroud)

但这仅适用于*xaml.cs文件,而不适用于普通的*.cs文件.

最好的祝福

.net c# wpf xaml parent

13
推荐指数
1
解决办法
4万
查看次数

Datagrip列选择器

是否可以在jetbrains数据夹点中使用列选择器.我无法在数据夹点中使用此功能.例如sql complete包含此功能:sql完成列选择器图像.

datagrip

3
推荐指数
1
解决办法
1416
查看次数

Leaflet GeoJson

有人可以解释一下为什么这个传单代码可用于可视化纽约州的GeoJson数据但我无法绘制纽约市的数据.我对QGIS中的文件使用了相同的导出首选项.

我使用了以下链接中的数据:

纽约市 http://www.nyc.gov/html/dcp/html/bytes/districts_download_metadata.shtml

纽约州 http://cugir.mannlib.cornell.edu/bucketinfo.jsp?id=7865

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
 <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
 <link rel="stylesheet" href="style_blank.css" />
</head>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
 <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
 <script src="sdfgsdgdfgfdsgd.js"></script>
  <div id="map"></div>
  <script>

  var map = L.map('map',{
    center: [5,28],
    zoom: 3,
    minZoom: 2,
    maxZoom: 18
  });

  L.geoJson(data, {
    style: function (feature) {
        return {color: feature.properties.color};
    },
    onEachFeature: function (feature, layer) {
        layer.bindPopup(feature.properties.description);
    }
}).addTo(map);
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

geojson leaflet

2
推荐指数
1
解决办法
721
查看次数

标签 统计

.net ×1

c# ×1

datagrip ×1

geojson ×1

leaflet ×1

parent ×1

wpf ×1

xaml ×1