Silverlight Cream for August 21, 2008 -- #353

Page Brooks with CoolMenu and Custom Collections for Controls, Bill Reiss on Calling WCF on local server, Mike Snow on Fast Sprite Animation, Tom Fischer on getting a color or brush from a string, Shawn Wildermuth on User Controls Base Classes, Tim Heuer on MS CRM, and Jesse Liberty on Getting Started with SL.

From SilverlightCream.com:
CoolMenu: A Silverlight Menu Control
Page Brooks posted a very nice menu... I'd call it a Toolbar, but in this SL2B2 create-your-own-paradigm world, it is what it is.. and it IS pretty nice looking! -- did I mention source :)
Adding Custom Collections to your Silverlight Controls
Going back one day, Page also has a great example of adding a Custom Collection to SL Controls.
Calling WCF on the server of origin from Silverlight
Bill Reiss discusses calling WCF on the same server as SL and why you may not be getting here from there and what to do to fix that.
Tip of the Day #30: Fast Sprite Animation in Silverlight
Mike Snow is up to 30 tips of the day, and this one is on Sprite Animation. I don't know much about game development, but I keep seeing sprites associated with it... so if that's your thing, here's some more things :)... seriously fun stuff, Mike, thanks!
How to get a Color or a SolidColorBrush from a String (by ColorName) for Binding
This is Tom Fischer's first entry on Silvelright Cream and he has an example of converting string color names to numerical property values.
Base Classes for User Controls
Shawn Wildermuth's students are still playing "Stump the band" with Shawn... this time they gave him a puzzle of sorts surrounding x:Subclass.
Silverlight and MS CRM Services
Tim Heuer reports on Microsoft CRM Services and gives some good links and explanations... definitely worth some time studying!
A Personal Guide to Getting Started with Silverlight
Jesse Liberty took some time to revisit the standard "How do I Learn Silverlight" question and is sharing that info with all of us...

Stay in the 'Light!

Twitter SLNews | Join me @ SilverlightCream | SL Web Articles | SL2 Web Articles | My Articles | My Tutorials | My Tooltips | My SL2 Articles | My SL2 ToolTips | SilverlightCream
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Thursday, August 21, 2008 11:04 PM
Print

Comments on this entry:

# re: Silverlight Cream for August 21, 2008 -- #353

Left by fu at 8/22/2008 4:12 AM
Gravatar
this program sucks it dosent work

# re: Silverlight Cream for August 21, 2008 -- #353

Left by Dave at 8/22/2008 6:28 AM
Gravatar
Great comment... let's see there were 8 entries in this post, but only 2 are 'programs'...

Page's menu works fine, and Mike's Sprite animation works... I just tried both.

-Dave

# Issues creating cool menu

Left by shashank at 8/20/2009 9:24 PM
Gravatar
i'm trying to build a dynamic menu with cool menu class, but nothing seems to be working if you plan to get your menu items from a web service or handler. i've written following code

void Page_Loaded(object sender, RoutedEventArgs e)
{
CoolMenuXmlReader reader = new CoolMenuXmlReader();
reader.MenuReceived += new MenuItemReceived(reader_MenuReceived);
WebClient client = new WebClient();
client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);
client.OpenReadAsync(new Uri("http://localhost:51815/CoolMenuContainerWeb/XMenuReader.ashx?oprtype=ReadXml"));
//reader.GetMenuItems();
//System.Threading.Thread.Sleep(new TimeSpan(0, 0, 60));
Color[] colors = { Colors.Red, Colors.Green, Colors.Blue, Colors.Purple };
int i = 0;
if (res != null)
{
foreach (string text in res)
{
Rectangle r = new Rectangle();
r.Height = 30;
r.Width = 30;
r.Fill = new SolidColorBrush(colors[i % colors.Length]);
CoolMenuItem cmi = new CoolMenuItem();
cmi.Content = r;
cmi.Text = text;
mnuMain.Items.Add(cmi);
}
}
}

NOW WHEN I RECEIVE MENU IN THE ASYNC WAY I TRY TO UPDATE THE MENU ITEMS

protected void reader_MenuReceived(object sender, MenuItemEventArgs e)
{
res = e.Result.Split(new Char[]{','});
Color[] colors = { Colors.Red, Colors.Green, Colors.Blue, Colors.Purple };
int i = 0;
App.Current.RootVisual.Dispatcher.BeginInvoke(delegate()
{
foreach (string text in res)
{
Rectangle r = new Rectangle();
r.Height = 30;
r.Width = 30;
r.Fill = new SolidColorBrush(colors[i % colors.Length]);
CoolMenuItem cmi = new CoolMenuItem();
cmi.Content = r;
cmi.Text = text;
mnuMain.Items.Add(cmi);
}
}
);
BUT THIS DOESN'T WORK AT ALL. ANY HELP WOULD BE A GREAT ONE.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910