Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将 UIElement 作为控件传递,然后调用 SetValue,我想知道如何将第一个参数作为控件类型从 UIElement 传递,而不是硬编码,如下所示的 ListBox
Control As UIElement Control.SetValue(ListBox.DisplayMemberPathProperty, ControlBinding.DataFieldName)
而不是 ListBox 使用 ItemsControl.DisplayMemberPathProperty