Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Help needed regarding HeaderedContentControl

Help needed regarding HeaderedContentControl

Scheduled Pinned Locked Moved WPF
wpfhelpcsharpwcfregex
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ravi Mori
    wrote on last edited by
    #1

    Hello.. I want some help from you guys in my wpf project. I prepared my project using MVVM pattern. I am using HeaderedContentControl and in content presenter of that i am using tab control. MyControl.xaml <Window.Resources> <Style x:Key="HeaderStyle" TargetType="{x:Type HeaderedContentControl}"> <Setter Property="HeaderTemplate"> <Setter.Value> <DataTemplate> <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Margin="4" Padding="4" SnapsToDevicePixels="True"> <TextBlock FontSize="14" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" Text="{TemplateBinding Content}" /> </Border> </DataTemplate> </Setter.Value> </Setter> <Setter Property="IsTabStop" Value="False" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type HeaderedContentControl}"> <DockPanel> <ContentPresenter DockPanel.Dock="Top" ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" /> <ContentPresenter ContentSource="Content" ContentTemplate="{TemplateBinding ContentTemplate}" /> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> <DataTemplate x:Key="MyWorkingTemplate"> <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" ItemTemplate="{StaticResource ClosableTabItemTemplate}" Margin="4" /> </DataTemplate> </Window.Resources> <HeaderedContentControl Content="{Binding Path=Workspaces}" ContentTemplate="{StaticResource MyWorkingTemplate}" Header="My Tabs" Style="{StaticResource HeaderStyle}" /> In Content template my all bindings working fine with viewmodel..But my problem is,in my header template here i have textblock and now i want here some content control and binding two different views here and show it according to requirement.. Any help??

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups