How to get "PART_CommitButton" Button?

2 posts, 0 answers
  1. Zhang
    Zhang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 02 Jan 2014 Link to this post

    For using Commands with DataForm, i need references of buttons which with a "PART_" prefix.
    Find DataForm.FindName("PART_CommitButton")" returns null. Is there any way?
  2. Zhang
    Zhang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 02 Jan 2014 Link to this post

    I found the way. The code snippet as follows and must be placed at loaded event:
                    
            void MainWindow_Loaded(object sender, RoutedEventArgs e)
            {
                var btns = DataForm1.ChildrenOfType<RadButton>();
                var btnCommit = btns.Single(x => x.Name == "PART_CommitButton");
                btnCommit.Command = CommitCommand;     
            }
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top