سؤال

Suppose I have a TabControl with some TabItems, each tab Item contains a UserControl.

Is there a way to convert the TabItem to a window when its dragged outside the application window and vice versa?

Just like google chrome except that the window will only contain what was inside the TabItem.

Any ideas on how to achieve this?

هل كانت مفيدة؟

المحلول

If you are using an MVVM pattern, you should be able to do this:

When you drag the tab item out of the tab control, send a command to the VM to which creates a new window, passes the original datasource from the view (the tab item) to the window, then remove the tab item from its parent (the tab control) via a command to the parent VM.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top