Click here to Skip to main content
15,891,657 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to install silverlight Pin
yogesh_kumar_agarwal29-Jun-10 19:39
yogesh_kumar_agarwal29-Jun-10 19:39 
AnswerRe: How to install silverlight Pin
Abhinav S29-Jun-10 20:13
Abhinav S29-Jun-10 20:13 
GeneralRe: How to install silverlight Pin
souidi abderrahman29-Jun-10 21:54
souidi abderrahman29-Jun-10 21:54 
GeneralRe: How to install silverlight Pin
Abhinav S1-Jul-10 20:12
Abhinav S1-Jul-10 20:12 
GeneralRe: How to install silverlight Pin
souidi abderrahman1-Jul-10 20:53
souidi abderrahman1-Jul-10 20:53 
AnswerRe: How to install silverlight Pin
Kunal Chowdhury «IN»30-Jun-10 1:03
professionalKunal Chowdhury «IN»30-Jun-10 1:03 
AnswerRe:How to install silverlight Pin
Ch.Gayatri Subudhi1-Jul-10 18:19
Ch.Gayatri Subudhi1-Jul-10 18:19 
QuestionApply two animations to a text block simultanously Pin
WBurgMo29-Jun-10 16:00
WBurgMo29-Jun-10 16:00 
I am trying to animate the FontSize and the rotation of a TextBlock. The FontSize animates but I can not get the
text to rotate. Here is the XAML

<Window x:Class="WpfSameGame.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="600" Width="550" WindowStartupLocation="CenterScreen"
    Loaded="Window_Loaded" Closing="Window_Closing">
  <Window.Resources>
    <DoubleAnimation
      x:Key="StringFontSize"
      To="20"
      AccelerationRatio=".5"
      DecelerationRatio=".5"
      Duration="0:0:02"
      Storyboard.TargetName="gameOver"
      Storyboard.TargetProperty="FontSize"
    />
    <DoubleAnimation
      x:Key="StringRotation"
      To="360"
      AccelerationRatio=".5"
      DecelerationRatio=".5"
      Duration="0:0:2"
      Storyboard.TargetName="gameOver"
      Storyboard.TargetProperty="TextEffects[0].Transform.Angle"
    />

  </Window.Resources>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="100"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="50"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <TextBlock Grid.Row="0" Grid.Column="0" FontFamily="comic sans ms" FontStyle="Italic"
               Foreground="Red" FontSize="20" HorizontalAlignment="Center"
               VerticalAlignment="Center" Name="textBlk">
      <Run FontSize="10" Name="gameOver" Text="" />
      <Run>Score: </Run>
      <Run Name="scoreText">0</Run>
    </TextBlock>

    <Button Width="70" Height="25" Click="NewGame_Click"
            VerticalAlignment="Center" HorizontalAlignment="Right">NewGame</Button>

    <UniformGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
      Rows="12" Columns="12" Width="504" Height="504" Name="gameGrid" Background="Cyan">
    </UniformGrid>
  </Grid>
</Window>


Here is the relevant code behind

DoubleAnimation fsa = this.FindResource("StringFontSize") as DoubleAnimation;
DoubleAnimation sra = this.FindResource("StringRotation") as DoubleAnimation;

Storyboard sb = new Storyboard();
TextEffect te = new TextEffect();
te.Transform = new RotateTransform(0);
this.gameOver.Text = "Game Over ";
gameOver.TextEffects.Add(te);
sb.Children.Add(sra);
sb.Children.Add(fsa);
sb.Begin(this.textBlk);

AnswerRe: Apply two animations to a text block simultanously Pin
Insincere Dave1-Jul-10 9:10
Insincere Dave1-Jul-10 9:10 
GeneralRe: Apply two animations to a text block simultanously Pin
WBurgMo1-Jul-10 10:35
WBurgMo1-Jul-10 10:35 
QuestionDetecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh29-Jun-10 4:19
kartheesh29-Jun-10 4:19 
AnswerRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Abhinav S29-Jun-10 20:30
Abhinav S29-Jun-10 20:30 
AnswerRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon29-Jun-10 22:15
mvePete O'Hanlon29-Jun-10 22:15 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh29-Jun-10 22:58
kartheesh29-Jun-10 22:58 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon30-Jun-10 7:05
mvePete O'Hanlon30-Jun-10 7:05 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh1-Jul-10 18:56
kartheesh1-Jul-10 18:56 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon1-Jul-10 11:59
mvePete O'Hanlon1-Jul-10 11:59 
QuestionHow do you generate classes from XAML in Visual Studio 2008? Pin
Xarzu28-Jun-10 12:31
Xarzu28-Jun-10 12:31 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
Abhinav S28-Jun-10 18:41
Abhinav S28-Jun-10 18:41 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
#realJSOP29-Jun-10 2:26
mve#realJSOP29-Jun-10 2:26 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
Pete O'Hanlon29-Jun-10 2:51
mvePete O'Hanlon29-Jun-10 2:51 
Questionwhy wcf use basicHttpBinding instead of wsHttpBinding Pin
ctlqt1228-Jun-10 9:44
ctlqt1228-Jun-10 9:44 
AnswerRe: why wcf use basicHttpBinding instead of wsHttpBinding Pin
Abhinav S28-Jun-10 18:35
Abhinav S28-Jun-10 18:35 
QuestionVS2008 Doesn't Allow Debugging of Silverlight apps [SOLVED] Pin
#realJSOP27-Jun-10 2:13
mve#realJSOP27-Jun-10 2:13 
AnswerRe: VS2008 Doesn't Allow Debugging of Silverlight apps Pin
Abhinav S27-Jun-10 7:12
Abhinav S27-Jun-10 7:12 

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.