Пример #1
0
 /// <summary>
 /// Sets distance unit visibility and selected distance unit.
 /// </summary>
 /// <param name="layerDetailsModel">Layer details view model</param>
 /// <param name="selectedLayerMap">Selected layer map</param>
 /// <returns>Updated layer view model</returns>
 private static LayerDetailsViewModel SetDistanceUnit(LayerDetailsViewModel layerDetailsModel, LayerMap selectedLayerMap)
 {
     if (layerDetailsModel.ColumnsView != null && layerDetailsModel.ColumnsView.Count > 0)
     {
         ColumnViewModel depthColumn = layerDetailsModel.ColumnsView.Where(columnValue => columnValue.SelectedWWTColumn.IsDepthColumn()).FirstOrDefault();
         ColumnViewModel xyzColumn   = layerDetailsModel.ColumnsView.Where(columnValue => columnValue.SelectedWWTColumn.IsXYZColumn()).FirstOrDefault();
         if (depthColumn != null || xyzColumn != null)
         {
             layerDetailsModel.IsDistanceVisible = true;
         }
         else
         {
             layerDetailsModel.IsDistanceVisible = false;
         }
         if (layerDetailsModel.DistanceUnits != null && layerDetailsModel.DistanceUnits.Count > 0)
         {
             layerDetailsModel.SelectedDistanceUnit = layerDetailsModel.DistanceUnits.Where(distanceUnit => distanceUnit.Key == selectedLayerMap.LayerDetails.AltUnit).FirstOrDefault();
         }
     }
     return(layerDetailsModel);
 }
Пример #2
0
 public MapColumnSelectionChangeHandler(ColumnViewModel columnViewModel)
 {
     this.parent = columnViewModel;
 }