SharePointAds TextOnly

Thursday, 11 February 2010

Silverlight: How to change color style for progress bar?



In silverlight we can use progress bar control, but it's default template is with little light colors.



in this progress control use forground = "Red" but in this control this color look very lighter than original. So what to do if we want to use original solid html colors?

I tried with different methods like using



1. MyAverageBar.Foreground = new SolidColorBrush(Colors.Red);

2.
MyAverageBar.Foreground = new SolidColorBrush(Color.FromArgb(255,255,0,0));

but actually its styling problem.

How to change default Style of progress bar?

I changed default style using Microsoft Expression Blend! (Blend is useful in those perpose means we can do this thing in Visual studio also but this is with long process... so blend is easier)

Follow the following steps:

  1. Open XAML file in Blend!
  2. Right click on your progress control bar and select Edit Template > Edit a Copy.
  3. It will open new window to allow to create style resource
  4. Change 'This document' option from 'Define In' section, click on dropdown and select progress bar control
  5. Click on OK
  6. Then again click on Progress bar control
  7. From properties window clickFill style in Brushes section, it will open new menu and then select 'Reset' menu.
  8. press Cntr+S (save xaml file)
With this style it will remove default color style



Now Progress bar control looks like above.. :)







Silverlight: How to use Timer Control?

MainPage.xmal:



In between control add following code,

<Grid x:Name="LayoutRoot">

<TextBlock Loaded="StartTimer" x:Name="myTextBlock" />

Grid>

Right click on "StartTimer" and select 'Navigate to Event Handler', it will create new event handler method in .cs file. Add following code in xmal.cs file:



MainPage.xmal.cs:

private void StartTimer(object sender, RoutedEventArgs e)

{

System.Windows.Threading.DispatcherTimer newDispatcherTimer = new System.Windows.Threading.DispatcherTimer();

newDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); // for 1 seconds

newDispatcherTimer.Tick += new EventHandler(Every_Seconds);

newDispatcherTimer.Start();

}

int iCounter = 0;

// Retrive after every 1000 millseconds(1seconds) while the DispatcherTimer is active.

public void Every_Seconds(object o, EventArgs sender)

{

myTextBlock.Text = "Second Counter : " + (iCounter++).ToString();

}



Hope this will clear timer concepts in Silverlight!!!







Tuesday, 2 February 2010

Sharepoint: Required Modifications for Podcasting

Podcasting in Sharepoint

From last 15 days I am trying to completing podcasting for my one of subsite. The PKS solution which has provided in codeplex solution is very good but still it’s in beta version(August 2009 Beta version) so it gives lots of problem specially URL referencing problems.

First time, as for practice demo I just installed on demo root site as suggested in documentation(Installation and Configuration Guide for PKS.docx), its working like charm for root site. After that I was trying to do same things for sub sites of different root site so that I followed Installation and Configuration Guide for PKS on Sub Site.docx file as for reference. But its gives lots of pain & problems to work.

The main problems I faced for PKS which are not specified anywhere.

  1. Problems to start media encoder service for other port sites.
  2. Changes in leftNav.xml file in PKS for subsite of subsite (In next post I will cover this!)

The main problem was of Media encoder service because in its config file we need to mention only one site at a time, so first time suppose to I installed PKS on http://sitename:101 port and suppose I want to install on different port site so I created new different site with name as http://sitename:102 so need to mention new site name in pks config file(FYI: you can find PKS config file at C:\Program Files\PKS\Media Encoder Service\ MediaEncoderService.exe.config ). So just simply follow the following steps to assign new PKS site name.

1. Uninstall the Media Encoder Service

2. Install new Media Encoder Service as per your Expression Encoder version(2 or 3) (Note: its Prerequisites to install Expression Encoder before PKS installation)

3. Follow all step as provided in documentation

4. Update MediaEncoderService.exe.config file and provide new site name.

5. Go to list PKS Media Encoder Monitor Locations and delete the entries in it

6. Go to PKS Configuration Settings list on the site:

a. Set the MediaEncoder.MonitorPath to you r location of External File Store

i. Example: C:\UploadFiles

b. Set the MediaEncoder.MonitorWeb to root of your PKS site collection

i. Example: http:// sitename:102

7. Go to the PKS Media Encoder Monitor Locations list on the site:

a. Click -> New Item

i. Update Title - Provide a unique title e.g. My Media Monitor List

Update WebID - you can get this from the Content Rating Configuration Settings , open the SharePoint site collection you have created. Go to Site ActionsàView All Site Contents. Open Content Rating Configuration Settings list under Lists section. There check for entry having value “//AllItems.aspx”. Do not copy the brackets, only the GUId Example: 7197e193-bd16-4369-b069-300642fece87

ii. And other information as suggested in documentation.

8. Start Media Encoder service from Run > services.msc

9. And reset IIS, IISReset

Friday, 25 December 2009

Sharepoint: How to manage Feature activation dependency?

In Sharepoint need to manage the dependencies in different features

For exp: Need to activate Feature A before activation of Feature B, So add below lines in Feature.xml file in Feature B before < / Feature > tag

< ActivationDependencies >

< ! -- Feature A’s ID - - >

< ActivationDependency FeatureId="D4000102-848E-4434-A1C5-C60C862F429C" / >

< / ActivationDependencies >

Refere feature A’s ID.

(*Please remove spaces in tags..)