|
If you're using Silverlight 2, you can use C# or VB.NET. If it's pre version 2, you had to use JavaScript.
|
|
|
|
|
Thanks Pete. You truly are an expert.
Pete O'Hanlon wrote: If you're using Silverlight 2, you can use C# or VB.NET. If it's pre version 2, you had to use JavaScript.
So if we use C# or VB, it will be Server side ? yes ?
|
|
|
|
|
Mohammad Dayyan wrote: So if we use C# or VB, it will be Server side ? yes ?
Well yes and no. The beauty about Silverlight 2 is it runs a low footprint CLR in the browser.
|
|
|
|
|
You can use either C# or VB.NET. Pick which ever one suits you best
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
But in Silverlight1 I couldn't use C# !!!
|
|
|
|
|
Mohammad Dayyan wrote: Silverlight1 I couldn't use C#
Which is why I didn't really look at Silverlight until Silverlight2. Are you developing in Silverlight1? If so, you should move to Silverlight2
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I'm building a proof of concept using VS 2008 and the very latest Silverlight 2.
What do I need to do to deploy to a commercial host? DiscountASP.net in this case. Is it simply a case of copying the contents of \release onto the server? Where is the FAQ on this topic - seems to be AWOL
Any help appreciated.
Thx++
|
|
|
|
|
I'd be interested in how that works too. There isn't anything useful in the help file about it...I'm thinking that it's the same as deploying an ASP.Net based site, so you might look from that perspective.
I did find one potential 'gotcha' about mime-types that I didn't know about here[^]
|
|
|
|
|
Hello David
Thanks - the addition of a 'publish' option in VS 2008 would have been a really good idea I think!
I hope I've persuaded the DiscountASP.Net people to write up a KB article about it.
|
|
|
|
|
Totally agree...feel free to share your hard earned knowledge here in the Silverlight forum when you get it
|
|
|
|
|
Jerry Evans wrote: I hope I've persuaded the DiscountASP.Net people to write up a KB article about it.
You could always write one, based on your experience with Silverlight and commercial hosting, and post it here on CP.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I managed to get a test Silverlight 2.0 Application working on my local copy of IIS 6.0/WinXP Pro...some things to know:
- It seems to work best if debugging is turned off in Web.Config, to change it, from VS2008 menus, go Website-->ASP.Net Configuration...that brings up an add-on for managing the security settings etc for your project.
- Mime-types: I found references for 2 mime types that need to be added in your IIS Control Panel:
- .xaml = application/xaml+xml
- .xap = application/x-silverlight
...see here[^] for the .XAML and here[^] for the .XAP This[^] is another reference to the mime type issue. If you add these yourself, make sure not to forget the period in front of the extension, or it doesn't work eg: '.xap' not 'xap'
- .Net 3.0 and 3.5 in Silverlight 2.0 still use the ASP.Net 2.0 stuff in IIS, make sure that your virtual directory under IIS is set to use ASP.Net 2.0 ...or your hosting provider has it set.
- When I created my Silverlight Project, I included an 'ASP.Net Website' for testing...I copy the entire contents from that to my IIS virtual folder...if I make changes and rebuild, I recopy the whole thing. The other project which is the actual Silverlight project gets compiled into a *.XAP file which is copied to the 'ClientBin' folder of the 'ASP.Net Website' project, so you don't need any files from the actual Silverlight project for deployment. So, if my project was called 'SilverlightApplication', you would wind up with a 'SilverlightApplication.Web' folder...copy the entire contents of that to your IIS folder...the files and folders were:
App_Data (folder)
Bin (folder)
ClientBin (folder with .XAP file)
Default.aspx
Default.aspx.cs
Silverlight.js
SilverlightApplicationTestPage.aspx
SilverlightApplicationTestPage.html
web.config
To load the site from a web browser, I put http://localhost/myvirtualfolder/SilverlightApplicationTestPage.html (or the aspx file).
I'm sure you can name your own files what you want etc...this is just a starting point to get all the pieces working.
|
|
|
|
|
I have an xbap application and I would like to hide controls on the page during runtime depending on whether the control is flaged as hidden in an Application hidden field table. Can someone tell me the equivance of reading controls on a page. Below is sample code that I used to read controls on a form before WPF.
private void HideControls()
{
foreach (Control c in Controls)
{
if (c.Controls.Count > 0)
{
}
else
{
if (c.Visible)
{
foreach (BUI.ApplicationHiddenField d in ApplicationHiddenFieldCollection)
{
if (d.Field.ToLower().Equals(c.Name.ToLower())) c.Visible = false;
}
}
}
}
}
Thanks
Jonso
|
|
|
|
|
There are several ways to do this.
The best way, is to DataBind the Visiblity property on the control, to a Boolean field on the data that has the value.
You can expose your Application Hidden Field Table as a property on the Window or UserControl, and have the controls in the UI Bind to that property.
You will need to use the BooleanToVisibilityConverter in your binding expression.
By data binding to the Visibility property of the control, you can change the data and the control will collapse, hide or display itself without any additional code.
Just ensure that your data class implements the System.ComponentModel.INotifyPropertyChanged interface.
Another way, not necessarily the best is to walk the VisualTree and set your controls. But I would not recommend this.
If you are knew to WPF data binding, search here on Code Project and the Internet for great tutorials and articles. My blog link below also has a good deal of data binding and links to other great blogs.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Karl Shifflett wrote: the BooleanToVisibilityConverter
OMG. The very first two value converters I wrote (and still use)
were VisibilityToBoolHideConverter and VisibilityToBoolCollapseConverter...
I had no idea that class existed LOL How many other converters are available?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I know there are more in 3.5 and ... I'll try and look them up next week at work.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Looks like 3 or 4 of them in the System.Windows.Controls Namespace,
depending on which documentation is used.
Doesn't look like I've invented any other wheels.
Thanks Karl.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Are there any anti-alias effects in WPF ?
If so, How can we use it ?
Thanks
|
|
|
|
|
In WPF, text is anti-aliased by default.. One cannot disable this.
|
|
|
|
|
Thanks elektrowolf.
elektrowolf wrote: In WPF, text is anti-aliased by default.. One cannot disable this.
What about Rectangle ? Can we apply it on a shape.
|
|
|
|
|
Does anyone know a good WPF chart component (.NET 3.0) ?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
|
Infragistics chart is REALLY good ...
|
|
|
|
|
Hi,
I have developed an animation application in WPF using DoubleAnimationUsingPath, simply i want to display the coordinates (Canvas.Top, Canvas.Left) of shape (say a rectangle shape) which gets continously updated while animating on the PathGeometry (say a ellipse using ArcSegment). I have used following XAML code for Creating Path geometry & then animating a rectangle on that path geometry:
<Grid.Resources>
<PathGeometry x:Key="animPath">
<PathFigure StartPoint="160,170" IsClosed="True">
<ArcSegment Point="140,175" Size="80,180"
SweepDirection="Clockwise" IsLargeArc="True" />
</PathFigure>
</PathGeometry>
</Grid.Resources>
.......
<Path Stroke="Black" x:Name="mainUI" >
<Path.Data>
<RectangleGeometry x:Name="rect00" Rect="0, 0, 60, 60" RadiusX="10" RadiusY="10"></RectangleGeometry>
</Path.Data>
<Path.Triggers>
<EventTrigger RoutedEvent="Line.Loaded">
<BeginStoryboard Name="change1">
<Storyboard>
<DoubleAnimationUsingPath Source="X"
RepeatBehavior="Forever" Duration="0 :15"
Storyboard.TargetProperty="(Canvas.Left)"
PathGeometry="{StaticResource animPath}" />
<DoubleAnimationUsingPath Source="Y"
RepeatBehavior="Forever" Duration="0 :15"
Storyboard.TargetProperty="(Canvas.Top)"
PathGeometry="{StaticResource animPath}" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Path.Triggers>
</Path>
...
Here I want to print on console the Canvas.Left & Canvas.Top property of Path when the animation has started and its gets continuosly changed everytime the Path changes its position on the PathGeometry as mentioned in DoubleGeometryUsingPath tag.
Hope you understood the query..
Thanks,
Suyesh.
|
|
|
|
|