Ismail
Ismail

Reputation: 644

WPF Windows to Tabs

I have an already made WPF application which is Windowed based and now I wish to implement tabbed controls instead of each of those separate windows. What would be the easiest and fastest way to reuse?

Thanks

Upvotes: 2

Views: 3260

Answers (3)

paparazzo
paparazzo

Reputation: 45106

Or you could convert you Windows to Pages and create frames in the tabs and put the page in the frame. It might be easier convert you Windows to Pages (and it might not) - depends on your Windows. I like the UserControl answer. Just putting another possilble option out there.

    <TabItem>
        <TabItem.Header>
             <TextBlock Style="{StaticResource TabItemHeader}">DocTxt</TextBlock>
       </TabItem.Header>
       <Frame Source="PageViewDocText.xaml" BorderThickness="0" Margin="0"/>   
    </TabItem>

Upvotes: 2

Philippe Lavoie
Philippe Lavoie

Reputation: 2593

Transfort all your windows into UserControl and build your new window with your TabControl.

Upvotes: 0

Ed Bayiates
Ed Bayiates

Reputation: 11230

Typically when I want to convert, I take the contents of each Window (which is usually wrapped in a Grid) and I convert them to a UserControl. You can basically move the entire Xaml and code-behind almost as-is, with only minor tweaks.

You then replace your Window contents with the UserControl, and you can reuse the same UserControl in a tab, or anywhere else.

Upvotes: 7

Related Questions