Tuesday, December 27, 2011

SilverLight


SilverLight?
What is XAML ?
Extensible Application Markup Language (XAML, pronounced zammel) is a declarative XML-based language created by Microsoft which is used to initialize structured values and objects.

What is the difference between WPF and SilverLight?
SilverLight uses a particular implementation of a XAML parser, with that parser being part of the SilverLight core install. In some cases, the parsing behavior differs from the parsing behavior in Windows Presentation Foundation (WPF), which also has a particular implementation.

Can you name built-in layout panels you have been using with SilverLight?
You are looking for Canvas, StackPanel and Grid.

How can I switch to Expression Blend from Visual Studio?
Expression blend provide great extensibility for XAML files.To switch to Expression Blend, right-click on the XAML file and select Open in Expression Blend

How can you set image Source dynamically from C# application to” test.png” file?
Surprisingly it is not as straight forward as it might sound, but anyone who seriously worked with SilverLight should be easily answer it. One of the ways is: img.Source = new BitmapImage(new Uri("test.png", UriKind.Relative));

How can I create image pieces/sub image?
Ans
: In straight way you create a subimage from an existing image. Here you just clip an image, Clipping is just different from Cropping. In clipping, first you have to dictate which part of the images to draw and later you have to remove all but the desired part of the image. SilverLight does not support cropping.

How does SilverLight 2 differ from Adobe Flash?
As I am from .Net background so in my views you can get C# / Vb.net compiled code but in Flash there is only action script.
You can find difference in depth at : http://SilverLight.net/forums/t/3015.aspx

How can I switch to Expression Blend from Visual Studio?
Expression blend provide great extensibility for XAML files.To switch to Expression Blend, right-click on the XAML file and select Open in Expression Blend.

How to start a SilverLight application with Visual Studio?
In the following step(s) I am giving the ideas all about:
1.Create a project:Here you just start your visual studio, Select your programming language [C#/VB], Choose Silverligh Template give the name and save it.
2. Adding SilverLight COntrols:One thing is happened here, controls cannot dragged onto the designer, you can draw/drag the controls on XAML page.
(a) Naming to control:In this step just give the name to your silverligt control like for Button you can give name as : btnmySilverligtButton
(b)Adding event handlers to SilverLight controls:Here you can give the event handlers like for click etc.
(c)Testing SilverLight applications in Visual Studio:Now just press F5 and test your application

What are the different ways to display text with SilverLight?
SilverLight supports displaying static preformatted text that is comprised out of glyph elements and also dynamic text that uses TextBlock. With glyphs, one needs to position the characters individually while TextBlock supports simple layout.

What kinds of fonts are supported with SilverLight?
Beyond standard and western fonts, SilverLight also supports East Asian characters, double-byte characters, and can work with any East Asian font or Middle Eastern font by using the glyphs element and a supporting TrueType font file that supports the requested glyph
Will SilverLight work with my new or existing Windows Media services platform for streaming?
Yes, in the final release. The CTP supports progressive download and playback from any server. In its final release, SilverLight will take advantage of Windows Server features for streaming

Will SilverLight support the full range of APIs offered by the Windows Media Player ActiveX control today?
We are actively speaking to customers and partners about their needs

Will SilverLight support digital rights management?
For content providers, SilverLight will support digital rights management (DRM) built on the recently announced Microsoft PlayReady content access technology on Windows-based computers and Macintosh computers

Will SilverLight-based applications run in Media Center? What about Media Center Extender?
SilverLight-based applications can run in Media Center but may have rendering issues on Media Center Extenders. Applications that are implemented using the Media Center SDK will provide a better experience.

Are there any new tools for creating and publishing media content with SilverLight?
Yes. The recently announced Expression Media Encoder, a feature of Expression Media, will support live and on-demand encoding and template-based publishing of SilverLight-based experiences and applications. In addition, SilverLight works with the broad range of Windows Media encoding tools and utilities available today. Additional details will be made available shortly.

What video encoding formats are supported?
The designer or developer is free to use any encoding format for their video supported by the Windows Media Video codec. This includes Variable Bit Rate (VBR) encoding for DVD-quality video and the use of the VC-1 codec for high-definition content. However, for HD content, be aware that the maximum output rate from the service is 700 kilobit/s, which means the client will not receive real-time delivery of HD video

What scalability does this system deliver? What if I have a large number of visitors to my Web site at the same time?
This service uses the Microsoft content delivery network specifically optimized for long-form video content. It has a provisioned global aggregate data rate in excess of 1 terabit/second.

Does this solution compete with content delivery networks (CDNs)?
No, this service uses the Microsoft CDN for the low latency delivery of media, and it does not compete with CDNs because it is specifically optimized for use with SilverLight RIAs

How is my content secured from unauthorized access?
You will have to be signed into the SilverLight Streaming service to manage your account and your SilverLight applications. Your SilverLight Streaming ID and secret key, associated to your Windows Live ID, will authenticate you as the unique and legitimate owner of the applications and content you upload to the service. You will also need this information to manage your SilverLight applications using the API. The SilverLight Streaming ID is public. However, the secret key should be kept confidential.

Can Microsoft® SilverLight Streaming service be used for non-video files such as music files?
Yes. All valid content encoded for SilverLight applications and presented with SilverLight can be used. This includes music files such as WMA and MP3. Business logic written in JavaScript can also be stored and streamed to the client, and in the future, any SilverLight Dynamic Language Runtime assemblies can also be used.
What are the main features and benefits of SilverLight?

-Compelling cross-platform user experiences.
-Flexible Programming Model with Collaboration Tools.
-High-quality media, low-cost delivery
-Connected to data, servers, and services

What audio or video formats are supported in SilverLight?
SilverLight supports Windows Media Audio and Video (WMA, WMV7–9) and VC-1, as well as MP3 audio. Additional formats may be available by the final release based on customer feedback.

Will SilverLight support all the codecs Windows Media Player supports?
Since SilverLight is a lightweight cross-platform technology, it only carries the most common codecs that are needed for Web playback. However, we are gathering information from customers about the needed codecs and can update SilverLight when necessary.

Will SilverLight support digital rights management?
For content providers, SilverLight will support digital rights management (DRM) built on the recently announced Microsoft PlayReady content access technology on Windows-based computers and Macintosh computers

Explain the relationship between SilverLight and Windows Media technologies?
SilverLight is built on top of Windows Media enabling developers and designers to collaborate in building media experiences and RIAs. SilverLight is released by the Server and Tools Division at Microsoft as a part of the .NET Framework

What is the relationship between SilverLight and Windows Media Player?
The SilverLight browser plug-in is a separate component, independent of Windows Media Player. SilverLight is designed for delivery of cross-platform, cross-browser media experiences and rich interactive applications (RIAs) inside a Web browser combining audio, video, animation, overlays, and more. Windows Media Player delivers a breadth of local playback and user focused experiences, while also offering support for application and Web page embedding

Will SilverLight-based applications and content run on any Web Server? What are the benefits to running it on servers running Windows?
Ans
: SilverLight works with any web server just like HTML. Video and audio content can also be downloaded and played back from any Web server platform.The main advantages of Windows server-based distribution of SilverLight applications include Windows Media Services with Fast Stream and Fast reconnect technologies, lower distribution costs and tap into the full Windows server ecosystem of platform components and partner solutions.

What features are missing from SilverLight presentation markup that will be supported in Windows Presentation Foundation?
High-end Windows specific features of WPF, such as real 3D, hardware-based video acceleration, and full document support, will not be supported in SilverLight. This is by design in order to serve SilverLight’s cross-browser, cross-platform reach scenario that demands a light weight plug-in.

Is SilverLight supported on various locales?
SilverLight installs on localized versions of Macintosh computers and Windows. At this time, the installation is available in an international English format. Final releases will render international text (using double-byte characters) and support the full 64K Unicode character set. SilverLight uses simple input mechanism that
treats all the languages in the same way.

What are the different ways to display text with SilverLight?
SilverLight supports displaying static preformatted text that is comprised out of glyph elements and also dynamic text that uses TextBlock. With glyphs, one needs to position the characters individually while TextBlock supports simple layout.
What kinds of fonts are supported with SilverLight?
Beyond standard and western fonts, SilverLight also supports East Asian characters, double-byte characters, and can work with any East Asian font or Middle Eastern font by using the glyphs element and a supporting TrueType font file that supports the requested glyph.

How much is the pay-for-use service if I chose not to use Microsoft-sponsored advertising?
We’re not prepared to discuss the final pricing of the nonadvertising-based product at this time except to say that it will be extremely cost competitive. The advertising-based product will continue to be free in perpetuity.

What is the difference between SilverLightTM Streaming and other video sharing services?
SilverLightTM Streaming is focused on developers who want to build their own media-rich applications or Web sites. Unlike other video sharing services, there are no third-party branding requirements for the use of SilverLightTM Streaming, and the developer is in full control over their rich media experience within the context of their Web site.

Why is this service branded with Windows LiveTM?
This service is part of the Windows LiveTM Platform.

It’s free—what’s the catch?
There is no catch. This is a new offering designed to accelerate the development of the next generation of media rich applications.

Can I tap into other Windows LiveTM services?
Yes, customers are able to use Windows Live IDTM and other Windows Live APIs today and in the future. SilverLight provides a great platform to consume these services.

Do you support digital rights management to protect my videos?
In the future, SilverLightTM Streaming will provide support for DRM-encoded video as an optional paid turnkey offering.

How does the service stream content?
Content is streamed progressively using a progressive download mechanism today. Active streaming support using Windows Media Services is being considered based on customer feedback in the future.

Can I stream live content/events?
No, the service only supports on-demand content today. Customers requiring additional capabilities are encouraged to contact a Windows Media Streaming Hosting Provider

Do I need to have the latest version of Windows Media Player installed?
No. SilverLight is completely independent and when installed is less than 2 MB in size.

Will SilverLight support all the codecs Windows Media Player supports?
Since SilverLight is a lightweight cross-platform technology, it only carries the most common codecs that are needed for Web playback. However, we are gathering information from customers about the needed codecs and can update SilverLight when necessary

Will SilverLight support live streaming events as well as downloading media?
Yes, in the final release. The February CTP is optimized for progressive "download and play" scenarios to test the platform.

Does SilverLight support MPEG4 and H.264 video, or Advanced Audio Coding (AAC) audio, or Flash video?
No. However, content from many of these formats can be transcoded into formats that are supported by SilverLight, such as by an automated server function (many available third-party solutions support this workflow), and then incorporated into a SilverLight-based application
What applications will Microsoft provide to make hosting easy?
Microsoft is building a simple uploading tool and working to add publishing support directly to SilverLight Streaming via Expression Media Encoder, a feature of Expression Media. In addition, third-party companies are adding support to their own applications for SilverLight Streaming

What is SMPTE VC-1?
VC-1 is an industry-standard video format, recognized by the Society of Motion Picture and Television Engineers (SMPTE), and most notably ships in all HD-DVD and Blu-ray Disc–certified electronics, hardware, and tools. Windows Media Video 9 (WMV-9) is the Microsoft implementation of the SMPTE VC-1 standard video codec. Microsoft initiated development of the standard with the release of WMV-9 to SMPTE

Will SilverLight support HD quality?
Yes, SilverLight supports 720p, HD quality with considerable performance benefits over other solutions. Performance is dependent upon the central processing unit (CPU) capabilities of your computer and configurations. Generally, in testing, a 3-gigahertz (GHz) CPU and/or dual-core support greatly benefit the HD playback experience

What is Microsoft® SilverLight Streaming by Windows LiveTM?
Microsoft® SilverLight Streaming by Windows LiveTM offers a free cloud-based hosting and streaming solution for quickly delivering high-quality, high-scale, cross-platform, cross-browser, media-enabled RIAs.

How much does SilverLight Streaming cost?
While the product is in Beta, hosting is free of charge. Up to 4 GB of data and streaming is free of charge up to 700 kilobit/s. At the conclusion of the Beta program, the developer can chose to enable Microsoft-sponsored advertising in the application for continued free use of the service to or subscribe to a pay-for-use service that is free of advertisements

How much storage do I get and what is the bit-rate?
A user receives 4 GB of free storage for SilverLight Streaming applications. Each media element in a SilverLight Streaming application cannot exceed a 10-minute uninterrupted video stream at 300 kilobit/s. The peak outbound bit rate for SilverLight Streaming is 700 kilobit/s. As the limit is set based on byte size instead of duration, by using the full bandwidth of 700 kilobit/s, the video will be truncated to approximately 4 minutes. Customers requiring additional capabilities are encouraged to contact aWindows Media Streaming Hosting Provider

Does SilverLight Streaming replace other video and file sharing services?
This service does not replace other video or file sharing services. SilverLight Streaming is intended to allow developers the power and flexibility to build such services themselves, and more.

What steps are being taken to ensure copyrighted content or illegal material is not uploaded?
The media owners as well as the SilverLight developers rendering content in their third-party Web sites are responsible for respecting the copyright of the content they expose. Microsoft reserves the right to remove from our servers any copyrighted content brought to our attention. The front page of our service has a Report Abuse button and the free-of-charge XAML templates that we provide include a similar button

Can I string together longer clips made of 10-minute files in a playlist?
Yes, so long as the total size of your SilverLight application content does not exceed the 4-GB storage limits of this free service
What is SilverLight Tool Kit?
To create an application or game you need to design, code and give some extra feature to your output. To do the above, you need some controls, IDE etc.
SilverLight Tool kit is nothing but is a collection of SilverLight Tools, Components etc. It includes source code describing the all you need to develop an application.
Please visit this link for more info:http://www.codeplex.com/SilverLight

What happened when I press F5 within Visual Studio to run SilverLight application?
When you run the SilverLight application within Visual Studio, a new folder created in the web-site project for SilverLight solution and it happened only first time. The folder name is ClientBin and having package with XAP extension which contains compiled project.

What is Storyboard in SilverLight?
Storyboard is a SilverLight class with controls animations with a timeline, and provides object and property targeting information for its child animations

Can I add more than one .xaml pages in SilverLight application?
Yes, you can have multiple .xaml files in a single project.
In the App.xaml, in the method Application_Startup you can choose, which page you want to initially display.

What is the best place to start SilverLight application?
There is no hard and fast rule to start SilverLight application. Every developer  can start as per his/her experience. like as per my case I always prefer Visual Studio. SO, in my view Visual Studio is the best place to start with SilverLight2 applications.Microsoft provides
templates for creating SilverLight applications and libraries in C# and Visual Basic.

Is SilverLight supported on various locales?
SilverLight installs on localized versions of Macintosh computers and Windows. At this time, the installation is available in an international English format. Final releases will render international text (using double-byte characters) and support the full 64K Unicode character set. SilverLight uses simple input mechanism that treats all the languages in the same way.

Is SilverLight the official name for "WPF/E"?
Yes. SilverLight was formerly code-named "WPF/E."

Does SilverLight web application work with all browsers ?
Yes, A web application developed by SilverLight technology can work with any browser

Is SilverLight a new media player?
No. SilverLight is a cross-browser, cross-platform plug-in for delivering media experiences and RIAs. It is not a desktop application or stand-alone media player.

How is my content secured from unauthorized access?
You will have to be signed into the SilverLightTM Streaming service to manage your account and your SilverLight applications. Your SilverLightTM Streaming ID and secret key, associated to your Windows Live ID, will authenticate you as the unique and legitimate owner of the applications and content you upload to the service. You will also need this information to manage your SilverLight applications using the API. The SilverLightTM Streaming ID is public. However, the secret key should be kept confidential.
What is the use of ClientBin folder?
ClientBin folder is used to place the .xap file of SilverLight application. You can keep this anywhere in your web application but this is the default that is used by the SilverLight.
What is name of Linux version of SilverLight?
The name is MoonLight.
What is RIA?
RIA means rich internet applications.
They are web applications with rich features.
Rich features include built in AJAX support, animations, layouts, audio and video components.
SilverLight applications are examples of RIA.
What is the difference between SilverLight 1 and SilverLight 2?
Nothing, SilverLight 2 is a full superset of SilverLight 1.0 - it is 100% compatible with SilverLight 1.0 applications and provides significantly more powerful features and functionality. SilverLight 1.0 applications even benefit from improvements in media playback and performance characteristics of SilverLight 2 with no additional work
How does XAP work in SilverLight?
A basic xap file in SilverLight will have an assembly related to specific code for the application, an application manifest file and any additional assemblies need to run the application. At a minimum, two files are needed, the application manifest file and the application assembly. For example:

AppManifest.xaml
MyPianoV2.dll

Once you have created the .xap file, the SilverLight 2 or 3 plug-in downloads the file and runs it in a separate work space.

A .xap file is used to contain and transfer the assemblies and resources of a managed code application. This managed code application must be run within the SilverLight 2 browser plug-in.
How you will Change application to full screen Mode in SilverLight?
Application.Current.Host.Content.IsFullScreen=true;
What is the difference Between WCF and RIA Services?
RIA Services is a library of client and server components that bolt on to ADO.NET Data Services. When the full stack of RIA Services is used the difference between RIA Services and plain WCF are as follow:

1.The client side data objects are generated using reflection at compile time based on the actual server side objects instead of a service contract. This allows RIA Services to provide a much richer client side object model by including any business rules and relationships between objects. However, this does mean that RIA Services gives up some flexibility compared to plain WCF. For example, the RIA Services serializaer does not currently support some data types which WCF would be able to handle.

2.RIA Services, like ADO.NET Data Services, supports serializing LINQ queries between the client and the server. This means that the client can create the LINQ query and have it run server side.

3.RIA Services, unlike plain ADO.NET Data Services, does not automatically generate CRUD at runtime. For people familiar with SQL Server, I describe ADO.NET Data Services as supporting regular triggers (aka query interceptors) while RIA Services requires INSTEAD OF triggers.
What do you mean by Deep Zoom and Deep Zoom Composer?
Deep zoom helps to view high resolution images in SilverLight application, using deep zoon one can zoom in and out with out affecting the performance of the application.

Deep zoom composer helps to create high resolution images for panning and smooth zooming.
Is dotnet framework needed to implement SilverLight?
No, It's a cross platform version of the .NET Framework which is included in the 6 MB SilverLight 4 download, so you do not need to have anything extra to be installed on the client in order to access SilverLight applications in the browser.
What is meant by Rich Internet Application(RIA)?
Microsoft .NET RIA Services provides support to make the n-tier application pattern by combining the ASP.NET and SilverLight platforms in a simple manner.
RIA Services presents a pattern which a help of that you can write application logic that can run on the mid-tier and controls access to data for queries, changes, and custom operations.
It support data validation, authentication, and roles by integrating with SilverLight components on the client and ASP.NET on the middle tier.
What are the different Layout controls available in SilverLight?
There are three controls available, they are;
StackPanel - this will position the child elements either in horizontal or in a vertical manner.
Grid - This will position the child elements in either columns or rows.
Canvas - This will position the child elements according to X,Y space.
What are the features and advantages of SilverLight?
It compel cross-platform user experiences.
It has Flexible programming model with collaboration tools.
It outputs High-quality media and with a low-cost delivery.
It can be Connected to data, servers, and services.
How to change the default page of a SilverLight application?
In a simple way we can set the default page, what we have to do is to change the default page of a SilverLight application, we have to set the RootVisual property inside the Application_Startup event of the App.xaml file.
    private void Application_Startup(object sender, StartupEventArgs e)
    {
        this.RootVisual = new MainPage();
    }
Name the Methods of a MediaElement object in SilverLight?
Play, Pause, and Stop are the methods of MediaElement.
Name the LayOut Management controls in SilverLight?
1)Canvas
2)Grid
3)StackPanel
How many Types of Brushes are there in Sivlerlight?
The different types of brushes in SilverLight are:-
1)SolidColorBrush
2)LinearGradientBrush
3)RadialGradientBrush
4)ImageBrush
5)VideoBrush.
Is there a way to generate more then on .xap file from a same SilverLight application?
Since for each .xap file we have to create a new SilverLight application.
How many ways you can display text using SilverLight?
SilverLight supports displaying static pre formatted text that is comprised out of glyph elements and also dynamic text that uses TextBlock. With glyphs, one needs to position the characters individually while TextBlock supports simple layout.
How do I use a .xap file in SilverLight?
A .xap file is used to contain and transfer the assemblies and resources of a managed code application. This managed code application must be run within the SilverLight 2 browser plug-in.
What are the files contained in the .xap file in SilverLight?
A basic xap file in SilverLight will have an assembly related to specific code for the application, an application manifest file and any additional assemblies need to run the application. At a minimum, two files are needed, the application manifest file and the application assembly.
For example:
AppManifest.xaml
MyPianoV2.dll
What is contained in the AppManifest.xaml file in SilverLight?
The AppManifest.xaml file contains the deployment details needed to run the SilverLight application.
Basic example:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="MyPianoV2" EntryPointType="MyPianoV2.App" RuntimeVersion="2.0.30523.4"> <Deployment.Parts> <AssemblyPart x:Name="MyPianoV2" Source="MyPianoV2.dll" /> </Deployment.Parts></Deployment>
What is the XAP mime type in SilverLight?
The .xap mime type is: application/x-SilverLight
Which platforms and browsers will SilverLight 2 supports?
SilverLight will support all major browsers on both Mac OS X and on Windows. Particular care is being taken to account for differences in platform and browser capabilities to ensure a consistent experience including experiences on Firefox, Safari, and Internet Explorer. Microsoft will extend the support for SilverLight on Linux through a partnership with Novell.


   
   
Thanks,
Anil

WPF



What is WPF?
Windows Presentation Foundation (Avalon was the code name for WPF) is the new presentation API in WinFX. WPF is a two and three dimensional graphics engine. It has the following capabilities:-
• Has all equivalent common user controls like buttons, check boxes sliders etc.
• Fixed and flow format documents
• Has all of the capabilities of HTML and Flash
• 2D and 3D vector graphics
• Animation
• Multimedia
• Data binding
What is XAML?
XAML (pronounced as Zammel) is a declarative XML-based language by which you can define object and properties in XML. XAML document is loaded by a XAML parser. XAML parser instantiates objects and set there properties. XAML describes objects, properties and there relation in between them. Using XAML, you can create any kind of objects that means graphical or non-graphical. WPF parses the XAML document and instantiates the objects and creates the relation as defined by XAML.
So XAML is a XML document which defines objects and properties and WPF loads this document in actual memory.
Does that mean WPF has replaced DirectX?
No, WPF does not replace DirectX. DirectX will still be still needed to make cutting edge games. The video performance of directX is still many times higher than WPF API. So when it comes to game development the preference will be always DirectX and not WPF. WPF is not a optimum solution to make games, oh yes you can make a TIC TAC TOE game but not high action animation games.

One point to remember WPF is a replacement for windows form and not directX. 
So can we define WPF in a precise way?
Windows Presentation Framework is the new presentation API. WPF is a two and three dimensional graphics engine. It has the following capabilities:-
• Has all equivalent common user controls like buttons, check boxes sliders etc.
• Fixed and flow format documents
• Has all of the capabilities of HTML and Flash
• 2D and 3D vector graphics
• Animation
• Multimedia
• Data binding
What is XAML?
XAML (pronounced as Zammel) is a declarative XML-based language by which you can define object and properties in XML. XAML document is loaded by a XAML parser. XAML parser instantiates objects and set their properties. XAML describes objects, properties and there relation in between them. Using XAML, you can create any kind of objects that means graphical or non-graphical. WPF parses the XAML document and instantiates the objects and creates the relation as defined by XAML.
So XAML is a XML document which defines objects and properties and WPF loads this document in actual memory.
  
 
So is XAML meant only for WPF?
No,XAML is not meant only for WPF.XAML is a XML-based language and it had various variants.
WPF XAML is used to describe WPF content, such as WPF objects, controls and documents. In WPF XAML we also have XPS XAML which defines an XML representation of electronic documents.
Silverlight XAML is a subset of WPF XAML meant for Silverlight applications. Silverlight is a cross-platform browser plug-in which helps us to create rich web content with 2-dimensional graphics, animation, and audio and video.
WWF XAML helps us to describe Windows Workflow Foundation content. WWF engine then uses this XAML and invokes workflow accordingly
There are ten important namespaces / classes in WPF.

System.Threading.DispatcherObject

All WPF objects derive from the DispatcherObject. WPF works on STA model i.e. Single Threading Apartment Model. The main duty of this object is to handle concurrency and threading. When any message like mouse clicks, button clicks etc are initiated they are sent to the DispatcherObject who verifies whether code is running on the correct thread. In the coming section we will look in to detail how WPF threading works.
System.Windows.DependencyObject
When WPF was designed property based architecture was considered. In other words rather than using methods, functions and events object behavior will interact using properties. For now we will only restrict ourselves to this definition. In the coming section we have dedicated question for the same.
 System.Windows.Media.Visual

Visual class is a drawing object which abstracts drawing instructions, how drawing should be drawn like clipping, opacity and other functionalities. Visual class also acts like a bridge between unmanaged MilCore.dll and WPF managed classes. When any class derived from visual it can be displayed on windows. If you want to create your own customized user interface then you can program using visual objects.
 
System.Windows.UIElement

UIElement handled three important aspects layout, input and events.
System.Windows.FrameworkElement
FrameWorkElement uses the foundation set by UIElement. It adds key properties like HorizontalAlignment , VerticalAlignment , margins etc.

System.Windows.Shapes.Shape

This class helps us to create basic shapes such as Rectangle, Polygon, Ellipse, Line, and Path.

System.Windows.Controls.Control

This class has controls like TextBox,Button,ListBox etc. It adds some extra properties like font,foreground and background colors.

System.Windows.Controls.ContentControl

It holds a single piece of content. This can start from a simple label and go down to a unit level of string in a layout panel using shapes.
System.Windows.Controls.ItemsControl
This is the base class for all controls that show a collection of items, such as the ListBox and TreeView.

System.Windows.Controls.Panel

This class is used for all layout containers—elements that can contain one or more children and arrange them as per specific layout rules. These containers are the foundation of the WPF layout system, and using them is the key to arranging your content in the most attractive, flexible way possible.
  
  
Q1. What is WPF?
WPF stands for Windows Presentation Foundation. It is an application programming Interface for developing rich UI on Windows. WPF is introduced in .NET 3.0. By the use of WPF we can create two and three dimensional graphics,animations etc.

Q2. What is XAML and how it is related to WPF?
XAML is a new mark up language which is used for defining UI elements and its relationships with other UI elements. The XAML is introduced by WPF in .NET 3.0 WPF uses XAML for UI design.

Q3. Does XAML file compiled or Parsed?
By default XAML files are compiled ,But we do have options to let it be parsed.

Q4. What is the root namespace used for Animations and 3D rendering in WPF?
System.Windows.Media namespace.

Q5. What are the names of main asseblies used by WPF?
a)WindowsBase
b)PresentationCore
c)PresentationFoundation

Q6. What operating systems support WPF?
Following are the operating systems that support WPF
a)Windows7
b)Windows Vista
c)Windows XP Service Pack 2 or later

Q7. Describe the types of documents supported by WPF?
There are two kinds of document supported by WPF
a)Flow format:Flow format document adjusts as per screen size and resolution
b)Fixed Format:Fixed Format document does not adjust as per screen size and resolution

Q8. What namespaces are needed to host a WPF control in Windows form application?
The following namespaces needs to be referenced :
a)PresentationCore.dll
b)PresentationFramework.dll
c)UIAutomationProvider.dll
d)UIAutomationTypes.dll
e)WindowsBase.dll
 
Q9. What is Dependency Property In WPF?
Windows Presentation Foundation (WPF) has a set of services that is used to extend the functionality of a common language runtime property. These services are referred as the WPF property system. A property that is backed by the WPF property system is known as a dependency property 
Q10.What is routed event in WPF?
A WPF user interface is constructed in a layered approach, where one visual element can have zero or more child elements. so we can visualise the elements tree for the full page. Routed events are a new feature provided by WPF which allows events to travel down the elements tree to the target element, or bubble up the elements tree to the root element. When an event is raised, it "travels" up or down the elements tree invoking handlers for that event on any element subscribed to that event it encounters en route.This tree traversal does not cover the entire elements tree, only the ancestral element chain between the root element and the element which is the target of the event.

Name the Layut Panels of WPF?

These are the five most layout panels of WPF:-
1)Grid Panel
2)Stack Panel
3)Dock Panel
4)Wrap Panel
5)Canvas Panel

What are the difference between CustomControls and UserControls in WPF?

CustomControl (Extending an existing control):-
----------------------------------------------
1)Extends an existing control with additional features.
2)Consists of a code file and a default style in Themes/Generic.xaml.
3)Can be styled/templated.
4)The best approach to build a control library.

UserControl (Composition):-
--------------------------
1)Composes multiple existing controls into a reusable "group".
2)Consists of a XAML and a code behind file.
3)Cannot be styled/templated.
4)Derives from UserControl.

What are the Advantages of XAML?

1)XAML code is short and clear to read.
2)Separation of designer code and logic.
3)Graphical design tools like Expression Blend require XAML as source.
4)The separation of XAML and UI logic allows it to clearly separate the roles of designer and developer.

jQuery concepts


Questions : 1 What is jQuery ?
 
Answers : 1 It's very simple but most valuable Question on jQuery means jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, animating, event handling, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. Jquery is build library for javascript no need to write your own functions or script jquery all ready done for you.
  
Questions : 2 How you will use Jquery means requirement needed for using jquery Answers : 2
Nothing more need to do just olny download jquery library(.js file) from any of the jquery site Download jquery and just linked with your html pages like all other javascript file
like below :
< script src="jquery.js" language="javascript" type="text/javascript"> 

   
Questions : 3 what the use of $ symbol in Jquery Answers : 3
$ Symbol is just replacement of jquery means at the place of $ you may use jquery hence $ symbol is used for indication that this line used for jquery 

Questions : 4 How do you select an item using css class or ID and get the value by use of jquery
Answers : 4
If an element of html like < div> , < p> or any tag have ID MyId and class used MyClass then we select the element by below jquery code

$('#MyId') for ID and for classs $('.MyClass') and for value

var myValue = $('#MyId').val(); // get the value in var Myvalue by id
Or for set the value in selected item

$('#MyId').val("print me"); // set the value of a form input      


Questions : 5 How to get the server response from an AJAX request using Jquery?
Answers : 5
When invoking functions that have asynchronous behavior We must provide a callback function to capture the desired result. This is especially important with AJAX in the browser because when a remote request is made, it is indeterminate when the response will be received.
Below an example of making an AJAX call and alerting the response (or error):
 $.ajax({
     url: 'pcdsEmpRecords.php',
     success: function(response) {
        alert(response);
     },
     error: function(xhr) {
        alert('Error!  Status = ' + xhr.status);
     }
 });

Questions : 6 How do you update ajax response with id " resilts"
Answers : 6
By using below code we can update div content where id 'results' with ajax response
 function updateStatus() {
     $.ajax({
            url: 'pcdsEmpRecords.php',
            success: function(response) {
             // update div id Results
             $('#results').html(response);
         }
     });
 }

Questions : 7 How do You disable or enable a form element?
Answers : 7
There are two ways to disable or enable form elements.
Set the 'disabled' attribute to true or false:
 // Disable #pcds
 $('#pcds').attr('disabled', true);
 // Enable #pcds
 $('#pcds').attr('disabled', false);
Add or remove the 'disabled' attribute:
 // Disable #pcds
 $("#pcds").attr('disabled', 'disabled');
 // Enable #x
 $("#pcds").removeAttr('disabled');


Questions : 8 How do you check or uncheck a checkbox input or radio button?
Answers : 8
There are two ways to check or uncheck a checkbox or radio button.
Set the 'checked' attribute to true or false.
 // Check #pcds
 $('#pcds').attr('checked', true);
 // Uncheck #pcds
 $('#pcds').attr('checked', false);
Add or remove the 'checked' attribute:
 // Check #pcds
 $("#pcds").attr('checked', 'checked');
 // Uncheck #pcds
 $("#pcds").removeAttr('checked');


Questions : How do you get the text value of a selected option? 
Answers :
Select elements typically have two values that you want to access. First there's the value to be sent to the server, which is easy:
 $("#pcdsselect").val();
 // => 1
The second is the text value of the select. For example, using the following select box:
 <select id="pcdsselect">

   <option value="1">Mr</option>
   <option value="2">Mrs</option>
   <option value="3">Ms</option>
   <option value="4">Dr</option>

   <option value="5">Prof</option>
 </select>
If you wanted to get the string "Mr" if the first option was selected (instead of just "1"), you would do that in the following way:
 $("#mpcdsselect option:selected").text();
 // => "Mr"


What is Jquery?

JQuery is Java Script library or Java Script Framework which helps in how to traverse HTML documents, do some cool animations, and add Ajax interaction to any web page. It mainly helps programmer to reduce lines of code as huge code written in Java Script, can be done easily with JQuery in few lines.

What does dollar Sign ($) means in JQuery?

Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code

$(document).ready(function(){

});

Over here $ sign can be replaced with "jQuery " keyword.

jQuery(document).ready(function(){

});


How is body onload() function is different from document.ready() function used in jQuery?


Document.ready() function is different from body onload() function because off 2 reasons.

1. We can have more than one document.ready() function in a page where we can have only one onload function.
2. Document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.


What are the steps you need to follow to use jQuery in ASP.Net project?

It's really simple. One just need to add reference of javascript file(.js). Go to Jquery.com and download the latest version of jQuery. When download is completed, there is a "jQuery-1.3.2.js" in the folder. Include this file

<script src="_scripts/jQuery-1.3.2.js" type="text/javascript"></script>

and you good to go now for JQuery.


What is JQuery UI?

JQuery UI is a library which is built on top of JQuery library. JQuery UI comes with cool widgets, effects and interaction mechanism.


What are features of JQuery or what can be done using JQuery?

Features of Jquery
1. One can easily provide effects and can do animations.
2. Applying / Changing CSS.
3. Cool plugins.
4. Ajax support
5. DOM selection events
6. Event Handling

Name some of the methods of JQuery used to provide effects?

Some of the common methods are :
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()

JQuery is replacement of Java Script?


What are the different type of selectors in Jquery?

There are 3 types of selectors in Jquery
1. CSS Selector
2. XPath Selector
3. Custom Selector

What are the advantages of JQuery ?
There are many advantages with JQuery. Some of them are :
. It is more like a JavaScript enhancement so there is no overhead in learning a new syntax.
. It has the ability to keep the code simple, readable, clear and reusable.
. It would eradicate the requirement for writing complex loops and DOM scripting library calls.
How can you select all elements in a page using jQuery?
To select all elements in a page, we can use all selectors, for that we need to use *(asterisk symbol).
<script language="javascript" type="text/javascript">
         $("*").css("border", "2px dotted red");
</script>
The above code will select all elements of the web page and apply border width as 2 pixel, style as dotted and color as red.

What is jQuery?

jQuery is not a language but it is a well written JavaScript code, As quoted on official jQuery website “it is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.“
In order to work with jQuery you should be aware of basics of JavaScript, HTML and CSS.
Why jQuery?
jQuery is very compact and well written JavaScript code that increases the productivity of the developer by enabling them to achieve critical UI functionality by writing very less amount of code.
It helps to
# Improve the performance of the application
# Develop most browser compatible web page
# Implement UI related critical functionality without writing hundreds of lines of codes
# Fast
# Extensible – jQuery can be extended to implement customized behavior
Other advantages of jQuery are
# No need to learn fresh new syntax's to use jQuery, knowing simple JavaScript syntax is enough
# Simple and Cleaner code, no need to write several lines of codes to achieve complex functionality.
Where to download jQuery from?
jQuery javascript file can be downloaded from jQuery Official website
How to use jQuery?
jQuery usually comes as a single JavaScript file containing everything comes out of the box with jQuery. It can be included within a web page using the following mark-up:
To load local jQuery file
<script type="text/javascript" src="jQuery-1.4.1-min.js"></script>
What is jQuery.noConflict()
jQuery is great library written on top of Java Script and its popularity is increasing day by day.The reason of popularity of jQuery is the plenty of useful, simple and easy to use plugins. But while using jQuery plugins, sometimes we include other libraries like prototype, mootools, YUI etc. The problem comes when one or more other libraries are used with jQuery as they also use $() as their global function and to define variables. This situation is creates conflict as $() is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced jQuery.noConflict().

How to use it?
1
2
3
4
5
6
7
8
9
10
11
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
     jQuery.noConflict();
     // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     }); 
     // Use Prototype with $(...), etc.
     $('someid').hide();
</script>
When .noConflict() is called then jQuery returns $() to its previous owner and you will need to use jQuery() instead of shorthand $() function. In this case, "jQuery" will be used in rest of the code. You won't be able to take advantage of shorthand.

There is another option if you want to take advantage of shorthand.
?
1
2
3
4
5
6
7
8
9
10
11
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
     var $j = jQuery.noConflict();
     // Use jQuery via jQuery(...)
     $j(document).ready(function(){
       $j("div").hide();
     }); 
     // Use Prototype with $(...), etc.
     $('someid').hide();
</script>
But you still love $() and don't want to lose it. So what to do? But there is a solution for this also.
?
1
2
3
4
5
6
7
8
9
10
11
12
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
     jQuery.noConflict();
     // Put all your code in your document ready area
     jQuery(document).ready(function($){
       // Do jQuery stuff using $
       $("div").hide();
     });
     // Use Prototype with $(...), etc.
     $('someid').hide();
</script>
What you need to do is in jQuery(document).ready() put function($) and now you use $ for your jQuery code.


Is window.onload is different from document.ready()
window.onload() is traditional Java script code which is used by developers from many years. This event is gets called when the page is loaded. But how this is different from jQuery document.ready() event?

Well, the main difference is that document.ready() event gets called as soon as your DOM is loaded. It does not wait for the contents to get loaded fully. For example, there are very heavy images on any web page and takes time to load. If you have used window.onload then it will wait until all your images are loaded fully, hence it slows down the execution. On the other side, document.ready() does not wait for elements to get loaded.


How to use jQuery Selectors with Examples
To work with an element on the web page, first we need to find them. To find the html element in jQuery we use selectors. jQuery provides many selectors out of the box. Let me explain some of the very useful selectors in “how to” ways.

How to select all elements of the page? - All Selector (“*”)
To select all elements of the page, we can use all selectors, for that we need to use *(asterisk symbol).
?
1
2
3
<script language="javascript" type="text/javascript">
$("*").css("border", "5px dashed green");
</script>
Above code will select all elements of the web page and apply border width as 5 pixel, style as dashed and color as green.

How to select a particular element having a specific class? - Class Selector (“.class”)
To select an element with a specific class, class selector can be used. We need to prefix the class name with “.” (dot).
?
1
2
3
<script language="javascript" type="text/javascript">
$(".class1").css("border", "5px solid green");
</script>
Above code will select all elements of the web page having class as “class1” and apply css style border width as 5 pixel, style as solid and color as green.

How to select all elements of specific type? - Element Selector (“element”)
To select all elements of specific type, we can use element selector. We need to use the html tag name.
?
1
2
3
<script language="javascript" type="text/javascript">
$("p").css("border", "5px solid green");
</script>
Above code will select all p (paragraph) elements of the web page and apply css style border width as 5 pixel, style as solid and color as green.

How to select an element having a specific id - ID Selector (“#id”)
To select an element having a specific id, id selector can be used. We need to prefix the id with “#” (hash symbol).
?
1
2
3
<script language="javascript" type="text/javascript">
$("#p1").css("border", "5px solid green");
</script>
Above code will select all html elements having id attribute as “p1” and apply css style border width as 5 pixel, style as solid and color as green.

How to select multiple elements at a time? Multiple Selector (“selector1, selector2, selectorN”)
To select multiple elements having different attributes, multiple selector can be used. We can mix the class selector, element selector, id selector all in this selector separated by “,” (comma).
?
1
2
3
<script language="javascript" type="text/javascript">
$("p.class1, #p1").css("border", "5px solid green");
</script>
Above code will select all paragraph (p) having class attribute set as “class1” and all html elements having id attribute as “p1” and apply css style border width as 5 pixel, style as solid and color as green.

How to select an element based on its attribute - Attribute Selector (element[‘attribute$=“name”]’)
To select an element based on a particular attribute value, attribute selector can be used. For example, if we have multiple textboxes on the page but we want to select all the textboxes which ends with id as “txtName”, we can use attribute selector.
?
1
2
3
<script language="javascript" type="text/javascript">
$('input[id$="txtName"]').val('My data');
</script>
Above code snippet will select the textboxes having id ending with “txtName” and set its value as “My data”.

Notice that as against all other selectors, this selector is written in the single quote (‘) instead of double quote (“) however the attribute value is written in the double quote (“).

How to select the first child of the parent element? - First child selector
To select first child of the parent element first child selector can be used.
?
1
2
3
<script language="javascript" type="text/javascript">
$("#div2 p:first-child").css("background", "red");
</script>
Above code snippet will select the first paragraph (p) element that is inside the div element whose id is “div2” and will change the background color as red.

How to select last child of the parent element? – Last child selector
To select the last child of the parent element last child selector can be used.
?
1
2
3
<script language="javascript" type="text/javascript">
$("#div2 p:last-child").css("background", "red");
</script>
Above code snippet will select the last paragraph (p) element that is inside the div element whose id is “div2” and will change the background color as red.

How to select a specific child of the parent element? nth child selector
To select the specific child of the parent element nth child select can be used.
?
1
2
3
<script language="javascript" type="text/javascript">
$("#div2 p:nth-child(2)").css("background", "red");
</script>
Above code snippet will select the 2nd paragraph (p) element that is inside the div element whose id is “div2” and will change the background color as red.


width() vs css('width') and height() vs css('height')
jQuery provides two ways to set width and height of any element. You can set using css or you can use jQuery provided methods. If you want to set width to 100px then
?
1
$('#dvText1').css('width','100px');
?
1
$('#dvText2').width(100);
Then what is the difference?

The difference lies in datatype. As its clear in code that with css method you need to append 'px' to the width value and with width you don't need to specify.

When you want to read width of any element then css method will return you string value like '100px' while width will return an integer value.
?
1
alert($('#dvText1').css('width'));
This return '100px'.
?
1
alert($('#dvText2').width());
This returns 100.


The same difference is with height and css('height').

  Is jQuery a library for client scripting or server scripting?
Ans: Client scripting
  Is jQuery a W3C standard?
Ans: No
  What are jQuery Selectors?
Ans: Selectors are used in jQuery to find out DOM elements. Selectors can find the elements via ID, CSS, Element name and hierarchical position of the element.
  The jQuery html() method works for both HTML and XML documents?
Ans: It only works for HTML.
  Which sign does jQuery use as a shortcut for jQuery?
Ans: $(dollar) sign.
  What does $("div") will select?
Ans: It will select all the div element in the page.
  What does $("div.parent") will select?
Ans: All the div element with parent class.
  What is the name of jQuery method used for an