|
I have no idea of both. But i want to learn.
So which one i can go for?
|
|
|
|
|
WPF is desktop
Silverlight is Web
This should be enough to base you decision on. Although the lines are quite blurred. Basically they are the same with the same learning curve - steep.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
So to start sliver light what are things i need to install?
and also give some good links or books to learn silver light?
|
|
|
|
|
For learning purposes, you could start with WPF.
Silverlight is more or less a subset of WPF.
Depends on what you want to do though.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Ok. thanks for the reply.
Can u suggest me some good links or books to learn?
|
|
|
|
|
Unfortunately, I'm not sure about WPF books.
For Silverlight, •Pro Silverlight 4" by Matthew MacDonald, is IMO, a good book.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Why not just search the Visual Tree for it? That would be a fairly simple, and convenient, way to do it. Just start at the root visual and iterate over the tree until you find it.
|
|
|
|
|
If you take a look at the VisualTreeHelper[^] class, you can use it to iterate over the visual tree from your root element (e.g. the top level window).
|
|
|
|
|
|
Could you please explain what the string variable "name" represents? Also please tell us in what class is the GetContentControl method defined?
|
|
|
|
|
My silverlight application seems to be using more memory and more memory every time I refresh the page.
If I close and re-open the page, the the memory usage is low but then if the page is refreshed each time, then the memory usage increases.
On each refresh of the page, the page retrieve data from the database and displays on a grid control on page.
I check the memory usage in the task manager...
How can I solve this please?
Thanks
|
|
|
|
|
For a start, don't rely on Task Manager as a gauge. It's a poor mechanism because it does not reflect real memory usage.
Get yourself a profiler and use that to monitor your application. Also, ensure that you don't maintain any hard references that aren't getting garbage collected. Unreleased event handlers are a typical bugbear here.
|
|
|
|
|
We had found in WPF before a memory leak in 3.5 if you used an indeterminate progress bar. They fixed it in WPF 4.0, but what version of Silverlight are you using? It could be a particular control.
Steve Maier
|
|
|
|
|
|
It still could be one of the controls causing it. i have not tested SL4 to see if anything there leaks.
Steve Maier
|
|
|
|
|
New to Silverlight - Using four areas Three of which looking for guidance to make a combo box work in a Silverlight Grid from a stored procedure:
Any thoughts are much appreciated
Hello,
I am new to silverlight. Can some please guide me with the appropriate syntax for displaying a combo lookup box which is being loaded by a stored procedure? In addition, can you tell me how to turn on and off the Display of the combo box. It requires two clicks to open the combo box. Here is my code:
XAML
<sdk:datagridtemplatecolumn x:name="patIdEssentrisColumn" header="Pat Id Essentris" width="SizeToHeader">
<sdk:datagridtemplatecolumn.celltemplate>
<datatemplate>
<textblock margin="2" text="{Binding PatIdEssentris}">
<sdk:datagridtemplatecolumn.celleditingtemplate>
<datatemplate>
<combobox name="cboTest"
=""
itemssource="{Binding GetComboboxItems_PatIdEssentris}"
displaymemberpath="PatientName">
Combo Box Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace CorporateHR.Web
{
public class ComboBoxItem
{
[Key]
public int ComboID_Int { get; set; }
public string ComboDisplayValue { get; set; }
private static List<comboboxitem> GetComboBoxItems(string strStoredProcedure)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RefConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand(strStoredProcedure, con);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
List<comboboxitem> comboList = new List<comboboxitem>();
con.Open();
SqlDataReader dr = cmd.ExecuteReader(behavior: CommandBehavior.CloseConnection);
while (dr.Read())
{
ComboBoxItem ComboBoxItem = new ComboBoxItem();
ComboBoxItem.ComboID_Int = Convert.ToInt32(dr[0].ToString());
ComboBoxItem.ComboDisplayValue = dr[1].ToString();
comboList.Add(ComboBoxItem);
}
return comboList;
}
public static List<comboboxitem> GetComboboxItems_PatIdEssentris()
{
return GetComboBoxItems("uspLookupPatIdEssentris");
}
//Secondary ComboBox Lookup:
public static List<comboboxitem> GetComboboxItems_Department()
{
return GetComboBoxItems("uspLookupPatIdEssentris");
}
}
}
Code Behind Page
namespace CorporateHR
{
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CorporateHR.LoginUI;
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.loginContainer.Child = new LoginStatus();
this.Loaded += new RoutedEventHandler(Page_Loaded);
}
void Page_Loaded(object sender, RoutedEventArgs e)
{this.employeeDataGrid.ItemsSource = GetComboboxItems_PatIdEssentris();}
private object GetComboboxItems_PatIdEssentris()
{
throw new System.NotImplementedException();
}
|
|
|
|
|
What do you mean when you say ?
can you tell me how to turn on and off the Display of the combo box
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
My combo box works outside the grid, but it does not work inside the grid.
Question: how do I make a combo box work inside of a grid.
The following code works fine outside of the grid, but does not work in the grid. How do I make this work inside the grid?
<u><b>This works outside of the Grid:</b></u>
<ComboBox Height="23" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=comboBoxItemDomainDataSource, Path=Data}" Margin="112,72,0,0" Name="comboBoxItemComboBox" VerticalAlignment="Top" Width="185" SelectionChanged="comboBoxItemComboBox_SelectionChanged" DisplayMemberPath="ComboDisplayValue">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
</Grid>
<riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:ComboBoxItem, CreateList=true}" Height="0" LoadedData="comboBoxItemDomainDataSource_LoadedData" Name="comboBoxItemDomainDataSource" QueryName="GetComboboxItems_PatIdEssentrisQuery" Width="0">
<riaControls:DomainDataSource.DomainContext>
<my:ComboBoxItemContext />
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
<u><b>This does not work within the Grid:</b></u>
<sdk:DataGridTemplateColumn x:Name="patIdEssentrisColumn" Header="Pat Id Essentris" Width="SizeToHeader">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="2" Text="{Binding PatIdEssentris}" />
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
<sdk:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Name="cboPatIdEssentris"
ItemsSource="{Binding Source={StaticResource comboBoxItemDomainDataSource}, Path=Data}"
DisplayMemberPath="PatientName"
/>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellEditingTemplate>
</sdk:DataGridTemplateColumn>
-- Modified Friday, February 11, 2011 4:32 PM
|
|
|
|
|
You may want to edit your post. Basically, you've added code that appears as HTML type tags; in other words, they are between <>tags. What you need to do is convert your tags to be <> tags so that they will display properly.
|
|
|
|
|
Hopefully this will show up now...
This works outside the grid:
<ComboBox Height="23" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=comboBoxItemDomainDataSource, Path=Data}" Margin="112,72,0,0" Name="comboBoxItemComboBox" VerticalAlignment="Top" Width="185" SelectionChanged="comboBoxItemComboBox_SelectionChanged" DisplayMemberPath="ComboDisplayValue">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel >
<ItemsPanelTemplate>
<ComboBox.ItemsPanel>
<ComboBox>
<Grid>
<riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:ComboBoxItem, CreateList=true}" Height="0" LoadedData="comboBoxItemDomainDataSource_LoadedData" Name="comboBoxItemDomainDataSource" QueryName="GetComboboxItems_PatIdEssentrisQuery" Width="0">
<riaControls:DomainDataSource.DomainContext>
<my:ComboBoxItemContext >
<riaControls:DomainDataSource.DomainContext>
<riaControls:DomainDataSource>
This does not work inside the grid:
< sdk:DataGridTemplateColumn x:Name="patIdEssentrisColumn" Header="Pat Id Essentris" Width="SizeToHeader">
< sdk:DataGridTemplateColumn.CellTemplate>
< DataTemplate>
< TextBlock Margin="2" Text="{Binding PatIdEssentris}" >
< DataTemplate>
< sdk:DataGridTemplateColumn.CellTemplate>
< sdk:DataGridTemplateColumn.CellEditingTemplate>
< DataTemplate>
< ComboBox Name="cboPatIdEssentris"
ItemsSource="{Binding Source={StaticResource comboBoxItemDomainDataSource}, Path=Data}"
DisplayMemberPath="PatientName"
>
< DataTemplate>
< sdk:DataGridTemplateColumn.CellEditingTemplate>
< sdk:DataGridTemplateColumn>
|
|
|
|
|
Hi,
How is it possible to fill the eclipse control with Green or red?
The following does not work and I can not find an example for this issue.
eclcontrol.Fill = "Green";
Thanks
|
|
|
|
|
The reason you are having a problem is because you have to use a brush to paint the colour in. So, you need to set your code to:
SolidColorBrush brush = new SolidColorBrush();
brush.Color = Colors.Green;
ellipse.Fill = brush;
|
|
|
|
|
I see.
I thought it was as easy as just setting the colour.
It makes sense now.
thank you.
|
|
|
|
|
The reason you need to use a brush is that Silverlight (and WPF) allow a lot of control over the painting, and this is achieved through the brushes. For instance, it's trivial to draw a gradient in Silverlight - it's a lot less so in GDI+.
|
|
|
|
|
I just can't seem to locate anything that gives me definitive stuff on being able to host multiple individual SilverLight applications on one web page.
I am looking to be able to create a few different individual SilverLight apps and place then on different areas of the page so the user can interact with them individually.
Just seem to be having a hard way to show how this is done.
Any good examples anyone is aware of?
|
|
|
|