Is it possible to set code behind a resource dictionary in WPF for event handling?

前端 未结 4 1863
孤城傲影
孤城傲影 2020-11-22 10:49

Is it possible to set code behind a resource dictionary in WPF. For example in a usercontrol for a button you declare it in XAML. The event handling code for the button clic

4条回答
  •  我在风中等你
    2020-11-22 11:07

    XAML is for constructing object graphs not containing code.
    A Data template is used to indicate how a custom user-object is to be rendered on screen... (e.g. if it is a listbox item) behavior is not part of a data template's area of expertise. Redraw the solution...

提交回复
热议问题