Click here to Skip to main content
15,905,233 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: OnChange of a model field Pin
Mycroft Holmes17-Nov-11 21:54
professionalMycroft Holmes17-Nov-11 21:54 
GeneralRe: OnChange of a model field Pin
Wayne Gaylard17-Nov-11 22:01
professionalWayne Gaylard17-Nov-11 22:01 
GeneralRe: OnChange of a model field Pin
Mycroft Holmes18-Nov-11 11:15
professionalMycroft Holmes18-Nov-11 11:15 
GeneralRe: OnChange of a model field Pin
Wayne Gaylard18-Nov-11 17:02
professionalWayne Gaylard18-Nov-11 17:02 
QuestionWell this Lambda expression works Pin
AghaKhan16-Nov-11 13:47
AghaKhan16-Nov-11 13:47 
AnswerRe: Well this Lambda expression works Pin
Abhinav S16-Nov-11 19:51
Abhinav S16-Nov-11 19:51 
QuestionUnable to bind StoryBoard to a label Pin
eli1502197916-Nov-11 10:05
eli1502197916-Nov-11 10:05 
AnswerRe: Unable to bind StoryBoard to a label Pin
Pete O'Hanlon16-Nov-11 10:56
mvePete O'Hanlon16-Nov-11 10:56 
You're getting this exception because it's expecting an Event Trigger here, not a data trigger. If you want to use a DataTrigger, you have to apply it to a Style, ControlTemplate or DataTemplate. If I were you, I would create a style something like this:
XML
<Style x:Key="LabelStyle1" TargetType="{x:Type Label}">
  <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  <Setter Property="Background" Value="Transparent"/>
  <Setter Property="Padding" Value="5"/>
  <Setter Property="HorizontalContentAlignment" Value="Left"/>
  <Setter Property="VerticalContentAlignment" Value="Top"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type Label}">
        <ControlTemplate.Resources>
          <Storyboard x:Key="Storyboard1">
            <ObjectAnimationUsingKeyFrames 
            Storyboard.TargetProperty="(ContentControl.Content)" Storyboard.TargetName="contentPresenter"
            RepeatBehavior="Forever" FillBehavior="HoldEnd">
              <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Posting."/>
              <DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="Posting.."/>
              <DiscreteObjectKeyFrame KeyTime="0:0:0.9" Value="Posting.."/>
              <DiscreteObjectKeyFrame KeyTime="0:0:1.2" Value="Posting..."/>
              <DiscreteObjectKeyFrame KeyTime="0:0:1.5" Value="Posting...."/>
              <DiscreteObjectKeyFrame KeyTime="0:0:1.8" Value="Posting....."/>
            </ObjectAnimationUsingKeyFrames>
          </Storyboard>
        </ControlTemplate.Resources>
        <Border BorderBrush="{TemplateBinding BorderBrush}" 
          BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" 
          Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
          <ContentPresenter x:Name="contentPresenter" 
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
            RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        </Border>
        <ControlTemplate.Triggers>
          <DataTrigger Binding="{Binding IsPendingPostExist}" Value="True">
            <DataTrigger.EnterActions>
              <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
            </DataTrigger.EnterActions>
          </DataTrigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
Then all you need to is define your label like this:
XML
<Label 
    Content="Posting" HorizontalAlignment="Left" 
    VerticalAlignment="Top" Foreground="ForestGreen" 
    Style="{StaticResource LabelStyle1}"/>

Forgive your enemies - it messes with their heads

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Unable to bind StoryBoard to a label Pin
eli1502197916-Nov-11 22:33
eli1502197916-Nov-11 22:33 
GeneralRe: Unable to bind StoryBoard to a label Pin
Pete O'Hanlon16-Nov-11 22:59
mvePete O'Hanlon16-Nov-11 22:59 
GeneralRe: Unable to bind StoryBoard to a label Pin
eli1502197917-Nov-11 1:17
eli1502197917-Nov-11 1:17 
GeneralRe: Unable to bind StoryBoard to a label Pin
Pete O'Hanlon17-Nov-11 2:12
mvePete O'Hanlon17-Nov-11 2:12 
GeneralRe: Unable to bind StoryBoard to a label Pin
Wayne Gaylard17-Nov-11 2:16
professionalWayne Gaylard17-Nov-11 2:16 
QuestionUnable to add event handler for Minimizing the Ribbon Control in WPF Pin
Kushagra Tiwari15-Nov-11 2:35
Kushagra Tiwari15-Nov-11 2:35 
QuestionGet RadioButtons from RadioButtonGroups and vice versa Pin
Defender-NF14-Nov-11 21:28
Defender-NF14-Nov-11 21:28 
AnswerRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Member 103390714-Nov-11 22:33
Member 103390714-Nov-11 22:33 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Defender-NF14-Nov-11 23:31
Defender-NF14-Nov-11 23:31 
AnswerRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Mark Salsbery15-Nov-11 4:22
Mark Salsbery15-Nov-11 4:22 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Defender-NF15-Nov-11 6:43
Defender-NF15-Nov-11 6:43 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Mark Salsbery15-Nov-11 10:15
Mark Salsbery15-Nov-11 10:15 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Defender-NF15-Nov-11 21:27
Defender-NF15-Nov-11 21:27 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Mark Salsbery16-Nov-11 5:35
Mark Salsbery16-Nov-11 5:35 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
SledgeHammer0116-Nov-11 6:39
SledgeHammer0116-Nov-11 6:39 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
Pete O'Hanlon16-Nov-11 6:39
mvePete O'Hanlon16-Nov-11 6:39 
GeneralRe: Get RadioButtons from RadioButtonGroups and vice versa Pin
SledgeHammer0116-Nov-11 6:42
SledgeHammer0116-Nov-11 6:42 

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.