Edit or customize FeatureDataForm or style?

550
1
06-28-2012 11:14 AM
KarenEllett
Occasional Contributor
I've downloaded the source code from Codeplex, and looked over it in VS.  My goal is to make two changes: disable the Apply/Commit button unless a particular field is filled out, and to close the window automatically once an edit is made.

I've seen some posts that imply I don't need to edit the source code for this, just the styling.  Can anyone give me a quick how-to on that, or point me in the right direction?  I've tried opening it in Expression Blend, but to be honest I have no idea how to access the style, much less make these changes.   If anyone can give me just a few starter hints, I'd appreciate it!  Thanks!
0 Kudos
1 Reply
JoeHershman
MVP Regular Contributor
I certainly don't think those changes could be done with styling, although I also cannot figure out Blend and not for lack of trying.

I think the latter change would be pretty straight forward just change the visibility in the CommitButton_Click


        private void CommitButton_Click(object sender, RoutedEventArgs e)
        {
            if (!this.IsReadOnly)
            {
                ApplyChanges();
                this.Visibility = Visibility.Collapsed;
            }
        }



For your former need, there is a HasChange() method which seems to check if any change is made to know if the Commit button should enable, you could add an additional check in there to see if that particular field was changed.

I have made custom versions of different tools myself, I think styling can only do so much.  Of course, maybe that is just because I can not make heads nor tails out of Blend 🙂

Good Luck
Thanks,
-Joe
0 Kudos