How can I use a DoubleAnimation to rotate the textblock ?

The following example uses a DoubleAnimation to rotate the textblock. The textblock performs a full rotation over a duration of 20 seconds and then continues to repeat the rotation. [XAML] <TextBlock Name=’MyRotatingText’ Margin=’20’ Width=’640′ Height=’100′ FontSize=’48’ FontWeight=’Bold’ Foreground=’Teal’ > This is rotating text <TextBlock.RenderTransform> <RotateTransform x:Name=’MyRotateTransform’ Angle=’0′ CenterX=’230′ CenterY=’25’/> </TextBlock.RenderTransform> <!– Animates the text block’s rotation. –> <TextBlock.Triggers> <EventTrigger RoutedEvent=’TextBlock.Loaded’> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName=’MyRotateTransform’ Storyboard.TargetProperty='(RotateTransform.Angle)’ From=’0.0′ To=’360′ Duration=’0:0:10′ RepeatBehavior=’Forever’ /> </Storyboard> </BeginStoryboard> </EventTrigger> </TextBlock.Triggers> </TextBlock>

How can I create a combined hard and soft shadow ?

This can be done as follows. [XAML] <!– Hard shadow on top of soft shadow. –> <TextBlock Text=’Shadow Text’ Foreground=’CornflowerBlue’> <TextBlock.BitmapEffect> <BitmapEffectGroup> <BitmapEffectGroup.Children> <DropShadowBitmapEffect ShadowDepth=’5′ Direction=’330′ Color=’DarkSlateBlue’ Opacity=’0.75′ Softness=’0.50′ /> <DropShadowBitmapEffect ShadowDepth=’2′ Direction=’330′ Color=’Maroon’ Opacity=’0.5′ Softness=’0.0′ /> </BitmapEffectGroup.Children> </BitmapEffectGroup> </TextBlock.BitmapEffect> </TextBlock>

How do I rearrange the columns in a DataGrid ?

The columns appear in the order in which their column styles were added to the tablestyle, being used by the grid. If you want to change this order, you need to create a new table style and add the column styles in the order you want things to appear. Here are some code snippets that suggest how to do this. [C#] public void MoveColumn(DataGrid _dataGrid, string _mappingName, int fromCol, int toCol) { if(fromCol == toCol) return; DataGridTableStyle oldTS = _dataGrid.TableStyles[_mappingName]; DataGridTableStyle newTS = new DataGridTableStyle(); newTS.MappingName = _mappingName; for(int i = 0; i < oldTS.GridColumnStyles.Count; ++i) { if(i != fromCol && fromCol < toCol) newTS.GridColumnStyles.Add(oldTS.GridColumnStyles[i]); if(i == toCol) newTS.GridColumnStyles.Add(oldTS.GridColumnStyles[fromCol]); if(i != fromCol && fromCol > toCol) newTS.GridColumnStyles.Add(oldTS.GridColumnStyles[i]); } _dataGrid.TableStyles.Remove(oldTS); _dataGrid.TableStyles.Add(newTS); } Sample usage private void button1_Click(object sender, System.EventArgs e) { MoveColumn( myDataGrid, ‘Customers’, 3, 1 ); }

How do I override the DataGridViewTextBox.Clone method ? In general, how do I implement ICloneable in a derived class ?

When the DataGridView needs to create a new cell in the column the method DataGridViewTextBoxCell.Clone is called in order to duplicate the ’DataGridViewColumn.CellTemplate’. It’s perfectly logical. You can override the Clone method, but you can’t call base.Clone() since it returns an object of the base class type and you can’t code a copy constructor because there is no copy constructor for DataGridViewTextBoxCell. With a base copy constructor you could code a Clone method like this : [C#] public override object Clone() { return new MyDataGridViewEditingTextBoxCell(this); } With your overridden copy constructor you could code a Clone method like this : public CustomDataGridViewTextBoxCell( CustomDataGridViewTextBoxCell cell) : base( cell ) { // Copy data of CustomDataGridViewTextBoxCell this.Flag = new Flag( cell.Flag ); this.Data = cell.Data.Clone() as Data; // … }