public AddPipeComponentTypeDialog()
        {
            InitializeComponent();

            PipeComponentTypeViewModel model = new PipeComponentTypeViewModel {View = this};
            DataContext = model;
        }
        public AddPipeComponentTypeDialog(int id)
        {
            InitializeComponent();
            Title = "Edit Pipe Component Type";

            PipeComponentTypeViewModel model = new PipeComponentTypeViewModel(id) {View = this};

            model.DataLoaded += () =>
                {
                    DataContext = model;
                    Utils.ResetOriginalValues(this);
                };
        }