|
It is being a busy little 'b' isn't it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas? - Because 31 Oct = 25 Dec.
Business Myths of the Geek #4 'What you think matters.'
|
|
|
|
|
Chris has hunted down and delivered a beeyitch slapping.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, All
i have VS2008 in my PC. Now i want to make a application in silverlight. I am unable to work with silverlight.
Acctually i have seen in the tutorials that we need to select silver light project from the new project window but i didn't find the same.
I have installed the silverlight by downloading it from silverlight.net but still but able to create the silverlight project.
I got a link for silverlight_Alpha for the same i install the same also, finally i got the silverlight template, but the problem remains the same when i tried to create a project i got a error "The project type is not supported by this installation"
So plz help me out. Plz tell me what to install for silverlight, from where i can download the same.
Thanks
Yogesh Agarwal
|
|
|
|
|
Since you are working with VS 2008, I'm assuming you must be installing Silverlight 3.
Just the SL runtimes are not enough for development.
You need the SDK + silverlight tooks (for VS 2008) which are included in the SL tools setup[^].
You will also need VS 2008 SP1.
|
|
|
|
|
you need to install Silverlight 3 SDK for vs 2008. not silverlight 4!!
|
|
|
|
|
souidi abderrahmen wrote: you need to install Silverlight 3 SDK for vs 2008. not silverlight 4!!
Correct. Since the OP is using VS2008, he can only use SL2 or SL3 and not SL4. This requires VS 2010.
|
|
|
|
|
that is right because i did the deploy on vs 2010, silverlight 4.
|
|
|
|
|
Hi Yogesh,
First of all, as you are using Visual Studio 2008 you can develop only Silverlight 3 applications using the IDE. Visual Studio 2008 doesn't support Silverlight 4. If you use Visual Studio 2010, you can develop both Silverlight 3 and Silverlight 4.
Assuming you want Silverlight 3 using Visual Studio 2008. For this, you need to install the Visual Studio 2008 SP1 (Service Pack 1). Once you upgraded to SP1, you need to download and install the Silverlight Tools for Visual Studio 2008 SP1.
Once installed properly, you will be able to create a new Silverlight project using your Visual Studio IDE.
Let me know, if you need more help.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
For vs2008 :
we have to install first in this serial order
1)xp service pack 3
2)SQL Server
3)VS 2008
4)VS2008 Service Pack1
5)Silverlight Tools
Cheers
Ch Gayatri
|
|
|
|
|
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);
|
|
|
|
|
You need to set the PositionCount of the TextEffect. te.PositionCount = this.gameOver.Text.Length;
|
|
|
|
|
Setting the "PositionCount" solved the problem. Thanks.
Now a second problem. With the animations defined as a window
resource, they run one time only. What do I have to reset in a
DoubleAnimation to reuse it?
For now I am creating the animations at run time. But I would
like to know how to reuse an animation.
|
|
|
|
|
Hi Experts,
I wanted to get the SelectedText on edit mode in WPF datagrid (i.e Active cell can be entire text or partial text selected by user within datagrid)
SelectedLength(Length of the selected text in datagrid cell), Selected Position (cursor position in datagrid cell). How these all values can be achieved in WPF datagrid. For better understanding please read the below example.
For Example: suppose user has double clicked datagrid in row 1 and col 2 position, data available on the selected position is Text. Consider user has selected only ext out of (Text). So my expected result should be
Selected Text: ext
Selected Position: 1
Selected Length: 3
Cell Text: Text
Thanks in advance
|
|
|
|
|
kartheesh wrote: Selected Text: ext
Selected Position: 1
Selected Length: 3
Cell Text: Text
A textbox provides these properties - not a text block.
A datagrid is composed of textblocks as cell components so this may not be possible until you style the datagrid differently.
|
|
|
|
|
If I was looking to do something more complex like this, I would consider rolling my own Blend behaviour or DependencyProperty that did this, and hook it up to the textboxes in the editable template. I would favour the Blend behaviour here as it is a lot easier to set up, and you are just going to be extending the TextBox control for this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi Experts,
Appreciate if anybody can help me out with small code snippet.
Thanks in advance.
|
|
|
|
|
To give you an idea what a Behavior looks like, he's one I put together for selecting all text when a textbox gets focus. You will want to consider creating a variation on this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Interactivity;
namespace Goldlight.Extensions.Behaviors
{
public class SelectAllTextBehavior : Behavior<TextBox>
{
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.GotKeyboardFocus += new System.Windows.Input.KeyboardFocusChangedEventHandler(AssociatedObject_GotKeyboardFocus);
AssociatedObject.GotMouseCapture += new System.Windows.Input.MouseEventHandler(AssociatedObject_GotMouseCapture);
}
protected override void OnDetaching()
{
base.OnDetaching();
AssociatedObject.GotKeyboardFocus -= new System.Windows.Input.KeyboardFocusChangedEventHandler(AssociatedObject_GotKeyboardFocus);
AssociatedObject.GotMouseCapture -= new System.Windows.Input.MouseEventHandler(AssociatedObject_GotMouseCapture);
}
void AssociatedObject_GotMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
{
AssociatedObject.SelectAll();
}
void AssociatedObject_GotKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
{
AssociatedObject.SelectAll();
}
}
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks for the reply buddy,exactly what my requirement is i will explain you.
I have created mdi form in WPF with few menus like copy,cut,paste and in my active form i have datagrid control.
Using copy,cut and paste functionality from the menu options i wanted to modify the datagrid cell data. As of now to implement the same i am doing workaround by refering the below link:
http://www.switchonthecode.com/tutorials/wpf-tutorial-using-the-clipboard
Appreciate to get help in this regards.
Thanks & Regards
Kartheesh
|
|
|
|
|
Let me balance out the 1 that somebody has voted you with a 5.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
How do you generate classes from XAML in Visual Studio 2008?
I have a Silverlight project. The XAML has been written in Expression Blend. I am told that I can use Visual Studio to use the grid classes in the Page.xaml file (the whole solution is loaded into Visual Studio) to generate the .CS (C#) files in Visual Studio 2008 that correspond to the several <grid> classes in the XAML. How is this done? Is there a wizard somewhere that will do this for me? Do I have to do this by hand?
When I open the Page.Xaml file and click on the name of the <grid> node, (x:Name) and select, to view code, it takes me to a file without much meat on it:
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
}
Since each <grid> contains a lot of components, I was expecting more.
Am I supposed to expand on this class by hand and code all the methods for this "Page" class? Is there a tutorial that shows how to do this?
There are so many videos to look at http://expression.microsoft.com/en-us/cc197141.aspx but they all seem to be focused on Expression Blend rather than how to use the XAML from Expression Blend to make Classes or to build on these classes.
On the other hand, are their example or sample code of how to take a "public partial class Page : UserControl" in C# and build from it?
|
|
|
|
|
Xarzu wrote: Am I supposed to expand on this class by hand and code all the methods for this "Page" class? Is there a tutorial that shows how to do this?
Yes. The Xaml represents the UI design - but if you need to add your own business logic, you still need to write code.
The code you need to write depends on what you intend to do - but do a search on the internet and you will find quite a few samples.
|
|
|
|
|
You should give your components names (x:Name=... ). At that point you can refer to them in your cs code. So, if you did this in your XAML:
<Grid x:Name="LayoutRoot" />
You could do this in your cs code:
this.LayoutRoot.Background = new SolidColorBursh(Colors.Red);
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
When you design something in XAML, no real code gets added into this Page class until compile time. Then a hidden .g.cs file is created which adds the definitions of the components in.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi all,
I found several links for this but no definitive answer. Could you please tell me the reason
|
|
|
|
|
AFAIK, wsHttpBinding is not supported in silverlight - Silverlight supports the WS basic profile, which uses basicHttpBinding and not wsHttpBinding.
|
|
|
|