|
What helped me was figuring out what 'cool things' I wanted to accomplish in my app and then spending some time doing proof of concept designs in a small isolated environment so I could see the effect I wanted in some uncluttered xaml, free of all the other application stuff that would normally be there.
I also second the other comment about using a design tool like the Expression suite to do the graphics work. Although VS is (IMHO) a good development environment, it sucks for doing anything graphical and remotely 'artsy'. You will only get frustrated. Get a copy of the Expression suite to play with to do your design in and keep VS for editing code.
AT least that was my experience with Silverlight. I have not done tons of straight WPF stuff yet, but I assume the experience would be the same.
|
|
|
|
|
Hi.
How can we use LINQ to XML in SilverLight 2 ?
Thanks.
|
|
|
|
|
|
Used in my project and works pretty well.
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
here's a code snippet
i start a new thread:
Thread timeThread = new Thread(UpdateDateTime);
timeThread.Start();
then i use this to update the labels:
delegate void UpdateDate(string date);
void updateDate(string date)
{
lblDate.Content = date;
}
delegate void UpdateTime(string time);
void updateTime(string time)
{
lblTime.Content = time;
}
void UpdateDateTime()
{
int seconds;
string time;
DateTime dt = DateTime.Now;
seconds = dt.Second;
for (; ; )
{
dt = DateTime.Now;
if (seconds != dt.Second)
{
seconds = dt.Second;
string dateString;
dateString = dt.Month + "/" + dt.Day + "/" + dt.Year;
lblDate.Dispatcher.Invoke(DispatcherPriority.Send, new UpdateDate(updateDate), dateString);
time = dt.Hour.ToString() + ":" + dt.Minute.ToString() + ":" + dt.Second.ToString();
lblTime.Dispatcher.Invoke(DispatcherPriority.Send, new UpdateTime(updateTime), time);
}
}
}
is there any more efficient way to update the clock without taking up 50% of my resources????
|
|
|
|
|
Use System.Windows.Threading.DispatcherTimer
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
works perfectly, takes up 0% of resources now. thanks so much.
|
|
|
|
|
That's not a timer, it's an endless loop. What did you expect ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
buy a quad-core and see it consumes only 25% now.
or insert a Thread.Sleep(500) in the for loop
or use a timer instead of a thread
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I am finding a solution in wpf which is similar to “treelistview” (http://www.codeproject.com/KB/list/treelistview.aspx)
I have an xml, which has lots of outer an inner node with same number and type of attribute.
According to hierarchy it should create tree and according to attributes it should create columns and display data contains in it.
Thanks
hiren shah
hirenkshah@gmail.com
Thanks
hiren shah
|
|
|
|
|
|
sir,
Thanks sir, it will help me lot but I wanted to put editable controls like textbox, checkbox etc in single column, According to Node type (Parent or child). With key navigation like F2 selected Row and 2nd columns editable control is appear.
Can you please help me regards to this problem.
Thanks.
Thanks
hiren shah
|
|
|
|
|
Have you even tried to play around with the controls I shared for you? What did you try which did not work ?
|
|
|
|
|
Hello everybody.
Can we get user session ID with SilverLight 2 ?
Is it possible at all ?
Thank you.
|
|
|
|
|
I don't know what "user session ID" you're referring to,
but I'll answer yes and yes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I don't know what "user session ID" you're referring to,
Well, I know a session ID from PHP that we could get it with session_id() function.
How many session ids do we have in SL2 ?
|
|
|
|
|
Mohammad Dayyan wrote: How many session ids do we have in SL2 ?
None.
Session IDs are a server side thing - Silverlight is a client technology.
You can use ASP.NET sessions through ASP.NET/WCF services...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark .
Mark Salsbery wrote: You can use ASP.NET sessions through ASP.NET/WCF services...
I'm working just with SL2 (client side) and I wanna get an unique thing for every visitor.
Can we get a something in SL2?
Is there an unique thing in Client side that I could get it with SL2 ?
Would appreciate for helping.
|
|
|
|
|
Mohammad Dayyan wrote: I'm working just with SL2 (client side) and I wanna get an unique thing for every visitor.
Silverlight runs on the client so it's already "unique".
There's no concept of "visitor" on the client side.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can inherit the session context in your WCF Services.
Just use:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MyService
But remember you will be responsible as well to keep alive that session (maybe service ping every X minutes).
HTH
Braulio
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
I have CSV numeric data in a text file, The first row is the column names, the rest is the data.
x,y,z
1.1, 2.1, 0.3
3.2, 4.1, 0.5
0.3, 4.2, 1.1
I want to read this into my application and display it in a list view. I presume I could use C# to open the file and read/parse each line, then add a row to the list view, but I'm wondering if their are WPF (or .Net) tools that can make this job easier.
I'm creating the text file by hand, so if a better format makes it easier, I'm open to ideas there too.
Thanks,
Mitch
|
|
|
|
|
This is probably overkill for simple CSV, but I found the following project by Matt Perdeck helpful:
LINQ to CSV library[^]
Even if you don't want to use the LINQ parts of the code you can get some tips for CSV parsing from it.
|
|
|
|
|
Hi - can someone help me with this seemingly easy problem? I'm missing something... I'm trying to reference an array from a user control-code behind. The array is defined in main codebehind Page.cs & populated in Page.cs constructor.
Any tips appreciated -- thank you
public partial class Page : UserControl // Page.cs with a string array called dcNames[]
{ public string[] dcNames;
...........
// Page.xaml includes a reference to the user control named: GlobalInfoGridControl.xaml
// User control GlobalInfoGridControl.xaml.cs
public partial class GlobalInfoGridControl : UserControl
{
.......
private void OnSliderValueChanged(object sender, RoutedEventArgs e)
{
Page p = this.Parent as Page;
foreach (string DC in p.dcNames) // method needs to read dcNames[] from Page.cs
modified on Friday, April 3, 2009 5:38 PM
|
|
|
|
|
I'm looking for a way to programmatically clear all text boxes and combo boxes on my WPF window at the same time. Is there a method for handling this?
|
|
|
|
|
I don't know of anything inherent. How about looping for all controls and if it is a textbox\combobox then reset its value? (might have to do it recursively if the controls are contained within an hierarchy.
modified on Saturday, April 4, 2009 7:00 AM
|
|
|
|