Select to view content in your preferred language

How to set binding for FeatureDataForm when using MVVM?

648
1
Jump to solution
04-08-2013 10:17 PM
yyp
by
New Contributor
Hello,

I am having an issue when using FeatureDataForm with MVVM.

In the View, I try like this:

<esri:FeatureDataForm
FeatureLayer=???{Binding SelectedFeatureLayer, Mode = TwoWay}???
GraphicSource="{Binding SelectedGraphic, Mode = TwoWay}"/>


In the ViewModel:

private FeatureLayer selectedFeatureLayer;
public FeatureLayer SelectedFeatureLayer
{
get { return this.selectedFeatureLayer; }
set { if (this.selectedFeatureLayer != value) { this.selectedFeatureLayer = value; RaisePropertyChanged("SelectedFeatureLayer"); } }
}

private Graphic selectedGraphic;
public Graphic SelectedGraphic
{
get { return this.selectedGraphic; }
set { if (this.selectedGraphic != value) { this.selectedGraphic = value; RaisePropertyChanged("SelectedFeatureLayer"); } }
}


And these is a FeatureLayer MouseLeftButtonUp event handler:


void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e )
{
        ...
        SelectedFeatureLayer = sender as FeatureLayer;
        SelectedGraphic = e.Graphic;
        ....
}


But it doesn't work. How can I solve it ?
0 Kudos
1 Solution

Accepted Solutions
yyp
by
New Contributor
The problem has been solved.
It is just because I forgot the FeatureLayer.Outfields...

View solution in original post

0 Kudos
1 Reply
yyp
by
New Contributor
The problem has been solved.
It is just because I forgot the FeatureLayer.Outfields...
0 Kudos