Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Expander Header="{Binding Path=MyProperty, StringFormat=Stuff: ({0})}" >
- <TextBlock Text="Some Content" />
- </Expander>
- <Expander HeaderStringFormat="{}Stuff ({0})" Header="{Binding Path=MyProperty}">
- <TextBlock Text="Some More Content" />
- </Expander>
- <Expander HeaderStringFormat="{}Stuff ({0:0})" Header="{Binding Path=MyProperty}">
- <TextBlock Text="Even More Content" />
- </Expander>
- <Expander>
- <Expander.Header>
- <TextBlock Text="{Binding Path=MyProperty, StringFormat=Stuff: ({0})}" />
- </Expander.Header>
- <Expander.Content>
- A Expander with working header
- </Expander.Content>
- </Expander>
- String.Format("My string value is: {0}", myValue");
- public class MyTestClass : IFormattable
- {
- #region IFormattable Members
- public string ToString(string format, IFormatProvider formatProvider)
- {
- if(format == "n")
- {
- return "This is my formatted string";
- }
- else
- {
- return "this is my non-formatted string";
- }
- }
- #endregion
- }
- <Style TargetType="{x:Type TabItem}">
- <Setter Property="HeaderStringFormat" Value="n" />
- <Setter Property="ContentStringFormat" Value="" />
- </Style>
- <TabControl>
- <TabItem Header="{Binding Content, RelativeSource={RelativeSource Self}}">
- <local:MyTestClass />
- </TabItem>
- </TabControl>
Add Comment
Please, Sign In to add comment