[Silverlight 2, C#] How to tell if a Storyboard is currently running?

Category: Silverlight, c#

To do this you can check the current ClockState of the animation.

bool isRunning = (MyStoryboard.GetCurrentState() == ClockState.Active);

Continue reading » 2 Comments

[C# 3.0+] Annonymous Types

Category: c#

What Does it do?
Annonymous Types

var annon = new { name1 = var1, name2 = var2, … };
// or
obj annon = new { name1 = var1, name2 = var2, … };

// Example
obj results = new { OriginalRequest = myRequest, Data = foundData, Status = dataStatus };
// Now you can see results.Data!

Limitations
I had originally wanted to use [...]

Continue reading » 2 Comments

[Javascript] Time, timers and time differences

Category: javascript

This should be easy, and perhaps I’m making it harder then it should be… I’m used to using the DateTime object, which confuses me when I have to switch back to javascript.
Anyhoot… here is how I have created a pseudo-timer that will spit out the time difference in seconds from when the timer is started [...]

Continue reading » 2 Comments

Lack of updates :(

Category: Uncategorized

Sorry for my lack of updates… I’ve been pulled off my Silverlight projects for the time and have been moved onto other tasks which involve jquery and Ext. Hopefully I’ll be back on C# track again soon!

Continue reading » No comments

[Silverlight 2, C#] Datagrid Not Sorting?

Category: Silverlight, c#

So I’ve been playing around with Siverlight datagrids. I have an xml page stuffed with data which I read into a custom class I made to store an xml node and it’s properties… I then databind a List of myClass to the datagrid itemsource and everything works fine – sorting worked fine right out [...]

Continue reading » 1 Comment

[Silverlight 2] Great FAQ Page

Category: Silverlight

I just bumped into this FAQ page on the Silverlight forums and I think it is an excellent read to become familiarized with some of the most common pitfalls people encounter when coding with Silverlight.
Silverlight.net FAQ Page
[This link posted 6/4/2009 and may change in the future. At time of posting this was based on [...]

Continue reading » No comments

[Silverlight 2, C#] Writing to and Reading from an IsoStorage File at the Same Time!

Category: Silverlight, c#

As I’ve mentioned in past posts, I have augmented the Silverlight Unit Test Framework to log errors it finds into a file in IsoStorage. This file is then read by a python script and results are sent via email if need be.
I ran into a problem today where my python script was [...]

Continue reading » 2 Comments

[C#] My StreamWriter isn’t Writing Properly!

Category: c#

I have a StreamWriter which is responsible for writing out to my test file, however, there is a chance that my test app may be killed before completed. Whenever this occurred, it seemed that my test file was blank! Even though I knew that I had written some data to the stream…
Turns out [...]

Continue reading » No comments

[C#] Using Reflection to Find a Function Name

Category: c#

I have a test script which will run and log errors found into a file in isolated storage. I wanted to be able to also log the name of the function that was being tested, and after a quick search I see that this can easily be found using Reflection.

System.Reflection.MethodBase thisFunction = System.Reflection.MethodBase.GetCurrentMethod();

string functionName [...]

Continue reading » No comments

[Silverlight 2, C#] Implementing an Observable Collection [on a custom class]

Category: Silverlight, c#

In order to improve some performance issues we were having, I needed to make a custom class that we were using become observable so that when we changed an item in the class the datagrid that the class was bound to would update automatically.
The datasource we were using was a custom class of ours, so [...]

Continue reading » 3 Comments