<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add Operational Layer to MapView Using MVVM in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006994#M9615</link>
    <description>&lt;P&gt;In general terms by passing the view model into the ICommand implementation (RadarCommand), the ICommand implementation and the view model are now tightly coupled.&amp;nbsp; This defeats one of the driving principles of MVVM.&amp;nbsp; You would need an ICommand implementation for every bound command.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Dec 2020 16:48:16 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2020-12-04T16:48:16Z</dc:date>
    <item>
      <title>Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006337#M9607</link>
      <description>&lt;P&gt;I am unable to add a layer to the mapview from a button click using the .net MVVM pattern in WPF. I have rigged the button using the ICommand interface and can activate the function in my MapViewModel but I have no clue how to add a featurelayer because I can't use my x:Name="mapView". What I want is to click my button and activate the AddAnotherLayer method, which I can do but I have no idea how to access the mapview to do this.&lt;/P&gt;&lt;P&gt;Does anyone have a simple example on how to do this without using galasoft or prism, just regular MVVM.&lt;/P&gt;&lt;P&gt;help....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MapViewModel.cs&lt;/P&gt;&lt;P&gt;public class MapViewModel : INotifyPropertyChanged&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; private Map _map = new Map(Basemap.CreateImageryWithLabels());&lt;BR /&gt;&amp;nbsp; &amp;nbsp; public RadarCommand RadarCommand { get; set; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public Map Map&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get { return _map; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set { _map = value; OnPropertyChanged(); }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public MapViewModel()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.RadarCommand = new RadarCommand(this);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CreateNewMap();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;protected void OnPropertyChanged([CallerMemberName] string propertyName = null)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var propertyChangedHandler = PropertyChanged;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (propertyChangedHandler != null)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; propertyChangedHandler(this, new PropertyChangedEventArgs(propertyName));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public async void CreateNewMap()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FeatureLayer trailHeadsLayer = new FeatureLayer(new&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uri("&lt;A href="https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0" target="_blank" rel="noopener"&gt;https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0&lt;/A&gt;"));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;await trailHeadsLayer.LoadAsync();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Map.OperationalLayers.Add(trailHeadsLayer);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine("all done loading");&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public async void AddAnotherLayer() {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; FeatureLayer featureLayer = new FeatureLayer(new&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uri("&lt;A href="https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer/0" target="_blank"&gt;https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer/0&lt;/A&gt;"));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await featureLayer.LoadAsync();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Map.OperationalLayers.Add(featureLayer);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("all trail lines done loading");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public event PropertyChangedEventHandler PropertyChanged;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;MainWindow.xaml&lt;/P&gt;&lt;P&gt;&amp;lt;Window.Resources&amp;gt;&lt;BR /&gt;&amp;lt;local:MapViewModel x:Key="MapViewModel" /&amp;gt;&lt;BR /&gt;&amp;lt;/Window.Resources&amp;gt;&lt;BR /&gt;&amp;lt;Grid&amp;gt;&lt;BR /&gt;&amp;lt;esri:MapView Map="{Binding Map, Source={StaticResource MapViewModel}}" x:Name="mapView" /&amp;gt;&lt;BR /&gt;&amp;lt;uc:TopToolbar/&amp;gt;&lt;BR /&gt;&amp;lt;/Grid&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 22:24:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006337#M9607</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2020-12-02T22:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006348#M9608</link>
      <description>&lt;P&gt;You're pretty much there.&amp;nbsp; Layers are added to a Map, not to a MapView.&amp;nbsp; You already have the Map which is bound to your MapView's Map property&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;public async void AddAnotherLayer() 
{
    //Do something to create a feature layer
    FeatureLayer featureLayer = new FeatureLayer(featureServiceUri);
    await featureLayer.LoadAsync();
    Map.OperationalLayers.Add(featureLayer);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 21:38:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006348#M9608</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2020-12-02T21:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006415#M9610</link>
      <description>&lt;P&gt;Thank for your help I am getting closer and made some edits above but I am still having a problem with my ICommand not adding AnotherLayer()&lt;/P&gt;&lt;P&gt;Do I need to add anything in my MainWindow.cs? Do I need to modify my Command class?&lt;/P&gt;&lt;P&gt;MainWindow.cs&lt;/P&gt;&lt;P&gt;public partial class MainWindow : Window&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public MainWindow()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RadarCommand.cs&lt;/P&gt;&lt;P&gt;public class RadarCommand : ICommand&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; public event EventHandler CanExecuteChanged;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; public MapViewModel MapViewModel { get; set; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public RadarCommand(MapViewModel mapViewModel)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.MapViewModel = mapViewModel;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public bool CanExecute(object parameter)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public void Execute(object parameter)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MapViewModel.AddAnotherLayer();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 22:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006415#M9610</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2020-12-02T22:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006471#M9611</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;I am still having a problem with my ICommand not adding AnotherLayer()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you clarify what problem? Is the code not executing, can you step through and see how far you come? Are you getting an exception? Is the layer getting added to the Map's layer collection, but it's just not showing on the map, or? If you step through, how far are you getting?&lt;BR /&gt;I also don't see in your code where you execute RadarCommand. Do you have something like&lt;/P&gt;&lt;P&gt;`&amp;lt;Button Command=&lt;SPAN&gt;"{Binding RadarCommand, Source={StaticResource MapViewModel}}" /&amp;gt;` anywhere&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;On a side-note: Be careful with this line: `&lt;SPAN&gt;await featureLayer.LoadAsync();`&lt;BR /&gt;If that throws (for instance if the server is down or there is a network glitch), your entire app will crash. Any &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;time you have a method that says "async void" instead of 'async Task', make sure you try/catch from before the first await call until the last line of code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 00:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006471#M9611</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2020-12-03T00:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006666#M9612</link>
      <description>&lt;P&gt;I tend to always wonder why someone doesn't want to use an external MVVM library, but that is a conversation for another day.&lt;/P&gt;&lt;P&gt;Without an external library generally, one would want to roll their own delegate command ICommand implementation which is pretty straight forward&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class DelegateCommand : ICommand
{
	private readonly Predicate&amp;lt;object&amp;gt; _canExecute;
	private readonly Action&amp;lt;object&amp;gt; _execute;

	public DelegateCommand(Action&amp;lt;object&amp;gt; execute) : this(execute, null)
	{
	}

	public DelegateCommand(Action&amp;lt;object&amp;gt; execute, Predicate&amp;lt;object&amp;gt; canExecute)
	{
		_execute = execute;
		_canExecute = canExecute;
	}

	#region ICommand Members

	public event EventHandler CanExecuteChanged;

	public bool CanExecute(object parameter)
	{
		return _canExecute == null || _canExecute(parameter);
	}

	public void Execute(object parameter)
	{
		_execute(parameter);
	}

	#endregion

	public void RaiseCanExecuteChanged()
	{
		CanExecuteChanged?.Invoke(this, EventArgs.Empty);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;With this one can just create an ICommand and pass the action into this DelegateCommand.&lt;/P&gt;&lt;P&gt;To simplify the MainWindow Xaml, instead of making the view model a static resource, bind it as the DataContext.&amp;nbsp; By doing this one does not need to set the source of the binding, it will be the defined DatContext&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Window x:Class="WpfApp2.MainWindow"
        ...
        xmlns:local="clr-namespace:WpfApp2"
        xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800" &amp;gt;
    &amp;lt;Window.DataContext&amp;gt;
        &amp;lt;local:MapViewModel /&amp;gt;
    &amp;lt;/Window.DataContext&amp;gt;
    &amp;lt;Grid&amp;gt;
        &amp;lt;esri:MapView Map="{Binding Map}" x:Name="mapView" /&amp;gt;
        &amp;lt;!-- Command is bound to ICommand on ViewModel --&amp;gt;
        &amp;lt;Button Content="Add Layer" Command="{Binding AddLayerCommand}"
                Height="40" Width="80" Margin="10,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/Window&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Now we just wire up our ViewModel&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class MapViewModel : INotifyPropertyChanged
{

	public MapViewModel()
	{
		CreateNewMap();
	}

	private void CreateNewMap()
	{
		//For sample using the viewpoint of the layer in code, 
		// personally I would not set an initial extent from a feature layer that needed to load at startup, 
		// but that's also a conversation for another day
		var targetGeometry =
			Geometry.FromJson(
				"{\"xmin\":-13240129.679701095,\"ymin\":3994281.9887753138,\"xmax\":-13106722.92583799,\"ymax\":4101417.5063218847,\"spatialReference\":{\"wkid\":102100,\"latestWkid\":3857}}");

		Map = new Map(Basemap.CreateImageryWithLabels())
		{
			InitialViewpoint = new Viewpoint(targetGeometry!)
		};
		Map.Loaded += (sender, args) =&amp;gt; { Console.WriteLine("all done loading"); };
	}


	private Map _map;

	public Map Map
	{
		get =&amp;gt; _map;
		set
		{
			_map = value;
			OnPropertyChanged(nameof(Map));
		}
	}
	
	//So here just create a DelegateCommand passing in the delegate, it will execute when invoked
	public ICommand AddLayerCommand =&amp;gt; new DelegateCommand(ExecuteAddLayer);

	//As pointed out by Morten, generally an async should return a Task, 
	// In this situation void is proper because it is a Delegate command
	private async void ExecuteAddLayer(object obj)
	{
		try
		{
			var trailHeadsLayer = new FeatureLayer(new Uri("https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0"));
			await trailHeadsLayer.LoadAsync();

			Map.OperationalLayers.Add(trailHeadsLayer);
			await Map.LoadAsync();
		}
		catch (Exception e)
		{
			Console.WriteLine(e);
		}
	}
	//remove INotifyPropertyChanged for sample purposes
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Dec 2020 17:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006666#M9612</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2020-12-03T17:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006975#M9614</link>
      <description>&lt;P&gt;Joel and Morten, I am going to give this a shot today and I will let you know. As for my command implementations it is like this. I did add a try catch statement around the loadasync and the button did work so my design pattern must be okay. The symbology did fail though because the trails are supposed to be pink and the point are a a round red symbol. I am going to replace the trails with NOOA's radar feed and see what I get. Thanks for all your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public class RadarCommand : ICommand&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; public event EventHandler CanExecuteChanged;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; public MapViewModel MapViewModel { get; set; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public RadarCommand(MapViewModel mapViewModel)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.MapViewModel = mapViewModel;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public bool CanExecute(object parameter)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; public void Execute(object parameter)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MapViewModel.AddAnotherLayer();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;User Control&lt;/P&gt;&lt;P&gt;&amp;lt;UserControl x:Class="Nav_Pro_6._1.Controls.TopToolbar"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" target="_blank" rel="noopener"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:x="&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml" target="_blank" rel="noopener"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:mc="&lt;A href="http://schemas.openxmlformats.org/markup-compatibility/2006" target="_blank" rel="noopener"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:d="&lt;A href="http://schemas.microsoft.com/expression/blend/2008" target="_blank" rel="noopener"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:local="clr-namespace:Nav_Pro_6._1.Controls"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:vm="clr-namespace:Nav_Pro_6._1"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mc:Ignorable="d"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d:DesignHeight="50" d:DesignWidth="800"&amp;gt;&lt;BR /&gt;&amp;lt;UserControl.Resources&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;vm:MapViewModel x:Key="viewModel"/&amp;gt;&lt;BR /&gt;&amp;lt;/UserControl.Resources&amp;gt;&lt;BR /&gt;&amp;lt;Grid&amp;gt;&lt;BR /&gt;&amp;lt;ToolBarPanel HorizontalAlignment="Left" Height="65" Margin="0,0,0,0" VerticalAlignment="Top" Width="800"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Button x:Name="button" Content="Radar" HorizontalAlignment="Left" Width="50" Height="48"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Command="{Binding RadarCommand, Source={StaticResource viewModel}}" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ToolBarPanel&amp;gt;&lt;BR /&gt;&amp;lt;/Grid&amp;gt;&lt;BR /&gt;&amp;lt;/UserControl&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 16:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006975#M9614</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2020-12-04T16:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add Operational Layer to MapView Using MVVM</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006994#M9615</link>
      <description>&lt;P&gt;In general terms by passing the view model into the ICommand implementation (RadarCommand), the ICommand implementation and the view model are now tightly coupled.&amp;nbsp; This defeats one of the driving principles of MVVM.&amp;nbsp; You would need an ICommand implementation for every bound command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 16:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/add-operational-layer-to-mapview-using-mvvm/m-p/1006994#M9615</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2020-12-04T16:48:16Z</dc:date>
    </item>
  </channel>
</rss>

