Hello,
I'd like to retrieve user input from a ProWindow dialog, then use that input to do a bunch of stuff in my MapView/Tables. Following this example (https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/ProWindowMVVM), I see them using Module1 to store/retrieve global variables, is this best practice in a case where I'll be building multiple ProWindow forms? I worry it will get overwhelming quickly if I want to track 5-10 properties per window.
Is there any other way of retrieving user input from a ProWindow? The ShowDialog() method only returns a boolean.
Happy to provide more details but I wanted to keep my question as simple as possible. As of right now my code is as follows as an example:
TestButton.cs:
namespace SurreyTools
{
internal class TestButton : Button
{
private CreateLotWindow _createlotwindow;
protected override void OnClick()
{
if (_createlotwindow != null)
return;
_createlotwindow = new CreateLotWindow();
_createlotwindow.Owner = FrameworkApplication.Current.MainWindow;
_createlotwindow.Closed += (o, e) => { _createlotwindow = null; };
_createlotwindow.ShowDialog();
}
}
}
CreateLotsWindowViewModel:
namespace SurreyTools
{
public class CreateLotWindowViewModel: PropertyChangedBase
{
private string _lotCount;
public string LotCount
{
get => _lotCount;
set
{
SetProperty(ref _lotCount, value, () => LotCount);
}
}
public ICommand SubmitLotNumber => new RelayCommand((createLotWindow) =>
{
(createLotWindow as CreateLotWindow).DialogResult = true;
(createLotWindow as CreateLotWindow).Close();
}, () => true);
}
}
I'd like some way to pass the lotCount property to either my button or any other use case.