PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


Saturday, October 2, 2010

How to create alternate rows in Gantt for Silverlight and WPF

image
   1: <local:BackgroundConverter x:Key="myConverter"/>
 
   1: <l:GanttRow Grid.Row="1"  ItemTemplate="{StaticResource TimeItemPres_blue_schedule}"  
   2:    ItemsSource="{Binding Path=Items}" 
   3:    Background="{Binding  Converter={StaticResource myConverter}}" ></l:GanttRow>

The Background is bound to “DataContext” that will be whatever the GanttRow represents – I add a Converter that can take my – in this case – DemoDataRow and turn it into a Brush:

   1: public sealed class BackgroundConverter : IValueConverter
   2: {
   3:  
   4:     #region IValueConverter Members
   5:  
   6:     public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
   7:     {
   8:         if (value is DemoDataRow)
   9:         {
  10:             LinearGradientBrush b=new LinearGradientBrush();
  11:             GradientStop gs1 = new GradientStop();
  12:             GradientStop gs2 = new GradientStop();
  13:             gs1.Color = Colors.Orange;
  14:             gs1.Offset = 0;
  15:             gs2.Color = Colors.Magenta;
  16:             gs2.Offset = 1;
  17:             
  18:             if ((value as DemoDataRow).Index%2==0)
  19:             {
  20:                 b.GradientStops.Add(gs1);
  21:                 b.GradientStops.Add(gs2);
  22:              
  23:                 return b;
  24:             }
  25:             else
  26:             {
  27:                 gs1.Offset=1;
  28:                 gs2.Offset=0;
  29:                 b.GradientStops.Add(gs1);
  30:                 b.GradientStops.Add(gs2);
  31:                 return b;
  32:             }
  33:                 
  34:         }
  35:         return new SolidColorBrush(Colors.Red);
  36:         
  37:     
  38:     }
  39:  
  40:     public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  41:     {
  42:         throw new NotImplementedException();
  43:     }
  44:  
  45:     #endregion
  46: }

Comments:
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.
 
I am really impressed the way you have written the blog. Hope we are eagerly waiting for such post from your side. HATS OFF for the valuable information shared!
AWS Training in Chennai
AWS Course in Chennai

 
Your post about technology was very helpful to me. Very clear step-by-step instructions. I appreciate your hard work and thanks for sharing.
R Training in Chennai
R Programming Training in Chennai

 
Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us R Programming institutes in Chennai
 
Very interesting blog.Thanks for sharing this much valuable information.Keep Rocking.
rpa training institute in chennai | rpa course fee in chennai | trending technologies list 2018

 
Your blog on RPA is so attractive that i am not able to stop myself to read this blog of yours on RPA.This blog contains all the important topics and points of RPA. Requesting you keep updating this post on RPAand help them who is eager to gain knowledge on RPA.
Thanks and Regards,
Uipath training in chennai
blue prism training institute in chennai
blue prism training with certification in chennai
 
This is really too useful and have more ideas and keep sharing many techniques. Eagerly waiting for your new blog keep doing more.
cloud computing courses in bangalore
cloud computing training in bangalore
Aws Training in Bangalore
Aws Course in Bangalore
cloud training in bangalore
cloud computing institutes in bangalore
 

This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to article very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
DedicatedHosting4u.com





 
This comment has been removed by the author.
 
Your post is very good. I got to learn a lot from your post. Thank you for sharing your article for us. it is amazing post
what is seo
types of seo


 
This is a fantastic idea! I like it a lot because it's super easy for the audience to see the value of opting in. wonderful and amazing post very use full your post thanks for sharing your article
Android Application development
Web application

 
When it comes to providing best assignment service online,
Unique Submission makes sure to complete assignment antecedently to offer scholars enough time to proof read the given assignment
before submitting it to their tutors/professors. We never compromise to timely delivery and deadlines given by our customers.


Assignment Help Services



 

As we all know that mobile apps are the biggest requirement of firms. Protocloud Academy is a leading Android Mobile app development institute in Jaipur. Our mentors will guide you to translate software requirements into workable programming code and maintain and develop programs with the help of live project training. They will also give you in-depth concepts knowledge in Android Application Development, JAVA language, and fine use of the Latest Android Studio and deployment on Android Devices like Smart Phone or Android Tablets. After completion of the training program, our experts will give advanced training to guide students with the latest technologies. We will provide the training certificates by approved technology partners to help students crack the interview and get their dream job.

https://www.protocloudtechnologies.com/android-app-development-course-in-jaipur/

 
Incredible post I should say and a debt of gratitude is in order for the data. Schooling is certainly a tacky subject. Be that as it may, is still among the main subjects within recent memory. I appreciate your post and anticipate more. You have made some valid statements there. I looked on the web to study the issue and discovered a great many people will oblige your perspectives on this site...
how to make a paper airplane eagle | how to make a boomerang airplane | the eagle paper airplane | best paper airplane design for distance and accuracy | best paper airplanes for distance and speed | what is the best paper airplane design for distance | paper airplane that flies far and straight | nakamura lock paper airplane instructions | paper airplane templates for distance | science behind paper airplanes

 

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ general

History