Click here to Skip to main content
15,867,308 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: INotifyPropertyChanged and ObservableCollection question Pin
BlitzPackage25-Feb-09 13:16
BlitzPackage25-Feb-09 13:16 
GeneralRe: INotifyPropertyChanged and ObservableCollection question Pin
Pete O'Hanlon25-Feb-09 21:31
subeditorPete O'Hanlon25-Feb-09 21:31 
QuestionNot able to set the default style for the controls with generic.xaml Pin
salon24-Feb-09 20:33
salon24-Feb-09 20:33 
AnswerRe: Not able to set the default style for the controls with generic.xaml Pin
Mark Salsbery25-Feb-09 10:16
Mark Salsbery25-Feb-09 10:16 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
salon25-Feb-09 17:21
salon25-Feb-09 17:21 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
Mark Salsbery25-Feb-09 21:20
Mark Salsbery25-Feb-09 21:20 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
salon25-Feb-09 23:20
salon25-Feb-09 23:20 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
Mark Salsbery26-Feb-09 7:30
Mark Salsbery26-Feb-09 7:30 
You didn't post a complete style example, so it's hard to guess what's wrong.

Here's an example that works for me:
<Style TargetType="local:MyControl">
    <Setter Property="VerticalAlignment" Value="Bottom"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="VerticalAlignment" Value="Bottom"/>
    <Setter Property="Foreground" Value="#FF0000FF"/>
    <Setter Property="FontWeight" Value="Bold"/>
    <Setter Property="FontStyle" Value="Italic"/>
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="Content" Value="The Code Project"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="local:MyControl">
                <TextBlock Text="{TemplateBinding Content}"
                           Cursor="{TemplateBinding Cursor}"
                           HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                           VerticalAlignment="{TemplateBinding VerticalAlignment}"
                           FontFamily="{TemplateBinding FontFamily}"
                           FontSize="{TemplateBinding FontSize}"
                           FontWeight="{TemplateBinding FontWeight}"
                           FontStyle="{TemplateBinding FontStyle}"
                           FontStretch="{TemplateBinding FontStretch}"
                           Foreground="{TemplateBinding Foreground}"
                           Margin="{TemplateBinding Padding}" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
salon26-Feb-09 17:47
salon26-Feb-09 17:47 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
Derek Greer31-May-09 5:28
Derek Greer31-May-09 5:28 
GeneralRe: Not able to set the default style for the controls with generic.xaml Pin
salon31-May-09 18:11
salon31-May-09 18:11 
QuestionFill tab items with separated code Pin
Fredrik__24-Feb-09 12:32
Fredrik__24-Feb-09 12:32 
AnswerRe: Fill tab items with separated code Pin
Gideon Engelberth24-Feb-09 15:20
Gideon Engelberth24-Feb-09 15:20 
QuestionCan we use ASP.NET website inside the Silverlight application Pin
salon24-Feb-09 0:59
salon24-Feb-09 0:59 
AnswerRe: Can we use ASP.NET website inside the Silverlight application Pin
Michael Sync24-Feb-09 17:04
Michael Sync24-Feb-09 17:04 
AnswerRe: Can we use ASP.NET website inside the Silverlight application Pin
johnsontroye27-Feb-09 9:34
johnsontroye27-Feb-09 9:34 
GeneralRe: Can we use ASP.NET website inside the Silverlight application Pin
Ray Cassick5-Mar-09 4:51
Ray Cassick5-Mar-09 4:51 
GeneralRe: Can we use ASP.NET website inside the Silverlight application Pin
Braulio Dez12-Mar-09 23:03
Braulio Dez12-Mar-09 23:03 
Questionscroll ListBox to bottom in xaml Pin
ausadmin23-Feb-09 14:48
ausadmin23-Feb-09 14:48 
AnswerRe: scroll ListBox to bottom in xaml Pin
User 27100928-Feb-09 20:02
User 27100928-Feb-09 20:02 
QuestionCreate a TextBlock in Blend and Edit it in RunTime Pin
Smithy96323-Feb-09 8:19
Smithy96323-Feb-09 8:19 
AnswerRe: Create a TextBlock in Blend and Edit it in RunTime Pin
Thomas Stockwell23-Feb-09 15:55
professionalThomas Stockwell23-Feb-09 15:55 
QuestionWPF data templating / binding Pin
pym23-Feb-09 3:33
pym23-Feb-09 3:33 
AnswerRe: WPF data templating / binding Pin
ABitSmart23-Feb-09 4:46
ABitSmart23-Feb-09 4:46 
GeneralRe: WPF data templating / binding Pin
pym23-Feb-09 5:39
pym23-Feb-09 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.