简体   繁体   中英

How to implement a mux control

I've implemented two different controls that allow a user to create and edit a filter for their data. Both controls have a DependencyProperty called Filter that implements my IFilter interface. One of the controls implements a RegularExpression filter, the other control implements a SelectionFilter (A list box where the select what items they want to filter on).

I'd now like to create a control that combines these filters into a CompoundFilterControl . The CoumpoundFilterControl should allow the user to select what type of filter they'd like to use. CompoundFilterControl

Ideally I'd like my CompoundFilterControl to also have a Filter DependancyProperty. Depending on which Tab is selected, I'd like the Filter from the appropriate control to be selected.

I have no idea how to do this. The only thought I've had is impelementing the TabControl's SelectionChanged event and attempting to Dynamically bind the appropriate sub-control's Filter property to the CompoundFilterControl's Filter DependancyProperty. Is this correct?

如果我了解您要执行的操作,则可以让您的组合控件也实现IFilter,并且该IFilter实现仅在所选选项卡中调用该控件的IFilter接口

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM