How do I Access Buttons inside a UserControl from xaml?

后端 未结 6 609
梦如初夏
梦如初夏 2021-01-17 11:51

At work I have several pages, each with buttons in the same places, and with the same properties. Each page also has minor differences. To that end, we created a userControl

6条回答
  •  猫巷女王i
    2021-01-17 12:25

    One option is to simply start writing C# on the xaml page using < ![CDATA[ *** ]]>

    In the Main Window.xaml you change to:

    
        
        
    

    Then right after Initialize Object() you call OnStartup().

    Although this does let you edit specific properties in the xaml, this is about the same as just writing the code in the code behind, where others expect it to be.

提交回复
热议问题