Anda di halaman 1dari 10

What are the types for data binding modes in WPF?

1.One-way binding:
The data flows from the source to the target,each time a change is made on the source
2.One-time binding:
Sends data from source to the target, however it does this only when the application is
started or when the datacontext changes
3.One-way-to-source binding:
sends data from the target to source
4.Two-way binding:(Default)
Sends the source to the target and if there are changes in the target, those values will
be sent back to the source.
What are the panels in WPF?
1.CANVAS - Explicitly positioning of controls
2.DOCKPANEL - Similar to windows form docking application
3.GRID - Can arrange child controls with rows and columns
4.STACKPANEL - Used to organize child controls either horizontally or vertically
5.WRAPPANEL - Can arrange child controls from left to right one after the other as
long as they fit in to next line
What are the Resources, Styles and Triggers?
Style - element containing setter elements.
Triggers - used to change the look and feel of the controls dynamically.
Resources - Styles and Triggers are stored in the resources
Static Resources - resources are searched at load time
Dynamic Resources - If the resource changes while the program is running
What is CLR Property?
CLR properties are really just safe wrappers around a Private member variable, such
that the correct access modifiers can be applied to the property, so we could have a
Read or a Read/Write or just a Write property. But basically that's it. This is all CLR
properties really do for us.
they are defined like this
private int x;
public int X
{
get { return x; }
set { x = value; }
}
What is dependency property in WPF?
WPF elements are classes with methods, properties and events. Nearly every property
of a WPF element is a dependency property. Dependency properties are used with
databinding, animation, resources and styles.
Only a class that derive from base class DependencyObject can include dependency
properties. For Example

public class MyDependencyObject : DependencyObject


{

public static readonly DependencyProperty SomeStateProperty =


DependencyProperty.Register("SomeState", typeof(String),
typeof(MyDependencyObject));

public string SomeState


{
get {return (string)this.GetValue(SomeStateProperty);}
set { this.SetValue(SomeStateProperty, value); }
}
}
What is attached property in WPF?
A WPF element can also get features from the parent element. For example, if the
button element is located inside a Canvas element. the button has Top and Left
properties that are prefixed with the parent element's name. Such a property is known
as attached property.

<Canvas>
<Button Canvas.Top="35" Canvas.Left="45">
Click Me!
</Button>
</Canvas>
What is Property Invalidation?
Its used to update the custom control whenever the property changes.Adding property
invalidation callbacks to a custom control is as easy as adding a
PropertyChangedCallback object to a PropertyMetadata object and add this
PropertyMetadata object to Register() or RegisterAttached() methods.
What are templates?
A template is similar to a style, and two different kinds are available:
Data templates: allow using XAML's DataTemplate element to specify a group of
characteristics for how data should be displayed. Colors, alignment, and more can be
defined once in a data template, then used elsewhere in an application's user interface.

Control templates: allow using XAML's ControlTemplate element to define the


appearance of a control.
What is Resource Dictionary?
The content of the file is just a ResourceDictionary - and because the
ResourceDictionary is the root element in the Xml file we need to define the default
namespaces, which you would probably be more used to seeing on a new root-level
Window or Page when you create a new Xaml file in Visual Studio. The contents of
the resource dictionary is a perfectly normal WPF style.
The second step is to merge this resource stored in an external file into one of the
resource dictionaries in our application. For this example we'll merge it in to the
Application.Resouces collection (located in the App.xaml file). This is done by
adding the elements highlighted below which point to the TextStyle.xaml file we
created.
what is ObservableCollection?
Represents a dynamic data collection that provides notifications when items get
added, removed or when the whole list is refreshed.
1234

what is the diff between Window and Page?


WPF Windows Application --Stand alone application

xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Title="Window1" Height="300" Width="300">

WPF Browser Application – XBAB

xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Title="Page1">

what is the diff between user control and Customcontrol in WPF?


--UI which will be used repeatedly in your own project, using UserControl is a much
simpler and preferred way.
--a portion of UI and functionality which you believe will be used aross different
projects, then using custom control is the right approach.
--A User Control doesn't support ControlTemplates and Themes. But creating a
UserControl is much like creating a normal Window with Codebehind. A UserControl
exists of a XAML-File and a Codebehind-File. Define Eventhandlers in XAML and
implement them in Codebehind.
--A Custom Control supports ControlTemplates and Themes. A Custom Control is a
"lookless" Control. The logic is in a Code-File (.cs) and the look is defined in a
ControlTemplate that is part of a style. You can define more "theme"-styles for
different windows themes.
What are trees in WPF?
Logical Tree and Visual tree.
The logical tree in WPF represents the elements of an application at run time.the
logical tree maps very closely to an application's markup definitions.
The visual tree contains all visual elements used in an application's user interface.
what is INotifyPropertyChanged?
This interface has only one member - the PropertyChanged event, which you are
supposed to call whenever a property changes. This, in turn, will notify WPF to
update the controls on the screen.
Example:
public class ConversionOptions : INotifyPropertyChanged
How WPF Application (Architecture) Works?
The major components of WPF are
-PresentationFramework,
-PresentationCore, and
-Milcore unmanaged component
Milcore is written in unmanaged code in order to enable tight integration with
DirectX. All display in WPF is done through the DirectX engine, allowing for
efficient hardware and software rendering. WPF also required fine control over
memory and execution. The composition engine in milcore is extremely performance
sensitive, and required giving up many advantages of the CLR to gain performance.
What are the main 3 components of WCF?
 Service Class
 Hosting Enviornment
 End point
Service Class
A service is a .NET class which contains methods exposed through the WCF service
[ServiceContract], [OperationContract], [DataContract].
Hosting Enviornment
The major ways of hosting environment by
 Selfhosting
 Hosting in IIS
 Hosting in WAS
Endpoint
A service can have one or more endpoints which allow a client to communicate with
the service. Endpoints are made up of 3 parts:
A – address (where), B – binding (how), C – contract (what).
What is LINQ - Language Integrated Query(OR Mapping)?

LINQ defines a set of query operators that can be used to query and filter data in
-arrays
-enumerable classes
-XML
-relational database

LINQ Query Operators


Select/SelectMany, Where, Join/GroupJoin, Take/TakeWhile, Skip/SkipWhile,
OffType, Distinct, Union etc
what is silverlight(WPFe)?
A programming model for developing and distributing rich Internet applications
(RIA) that use graphics, animations or video within the .NET framework. Silverlight
was previously known by its code name, Windows Presentation Foundation
Everywhere.

ASP.NET Silverlight controls

1.Media server control


This control enables you to easily integrate media sources such as audio (WMA) and
video (WMV) into your Web application, without requiring any knowledge of XAML
or JavaScript

2. Xaml server control


this control provides a mechanism to embed your XAML application within the Web
page.
Prerequisites
-Visual studio 2008
-ASP.NET AJAX Extensions 1.0
What are the features supported in .NET 3.0 Framework?
.NET Framework 3.0, formerly called WinFX consists of four major new components
including version 2.0 of Framework.
There is no change in version 2.0 CLR(Common Language Runtime).

1.Windows Presentation Foundation (WPF), formerly code-named Avalon


2.Windows Communication Foundation (WCF), formerly code-named Indigo
3.Windows Workflow Foundation (WWF)
4.Windows CardSpace (WCS), formerly code-named InfoCard
What is Enterprise Library 3.0 Application Blocks?
Enterprise Library 3.0
Application Blocks are reusable, extensible source-code components that provide
guidance for common development challenges.Enterprise Library is a collection of
general purpose application blocks.
This new release of Enterprise Library includes (bold = new):

 Caching Application Block


 Configuration Application Block
 Cryptography Application Block
 Data Access Application Block
 Exception Handling Application Block
 Logging Application Block
 Policy Injection Application Block
 Security Application Block
 Validation Application Block
1234

What is BizTalk?
BizTalk is a business process management (BPM) server that enables companies to
automate and optimize business processes. This includes powerful, familiar tools to
design, develop, deploy, and manage those processes.

Everything you need for easy installation is included integrated management tools,
support for Web services, and a new business activity monitoring (BAM) portal. In
addition, BizTalk Server 2006 includes 23 application and technology adapters in the
box for connecting to legacy systems (mainframe and mid-range) and line-of-business
applications (SAP, Siebel, PeopleSoft, Oracle, and JD Edwards).
What is XSL?
XSL consists of three parts:
XSLT - a language for transforming XML documents
XPath - a language for navigating in XML documents
XSL-FO - a language for formatting XML documents
What is Service-Oriented Architecture (SOA)?
In this changing business climate, where globalization and demanding customers
require agility and flexibility, retailers' IT systems are not helping them in meeting
these expectations. Most of the legacy retail systems were built following tightly
coupled point-to-point integration principles. Service orientation offers great benefits
in moving from these legacy systems to more flexible and agile systems.

 SOA is a design philosophy independent of any product, technology, or industry


trend.
 SOAs can be realized using Web services, but using Web services will not
necessarily result in a SOA
 EDI, CORBA, and DCOM were conceptual examples of SO.
 SOA is not a methodology.
 SOAs are like snowflakes: No two are the same.
 SOA should be incremental and built on your current investments.
 SOA requires tools, not consultants.
 SOA is a means, not an end.
What is Agile software development?
Agile methods are a family of development processes, not a single approach to
software development. In 2001, 17 prominent figures [2] in the field of agile
development (then called "light-weight methodologies") came together at the
Snowbird ski resort in Utah to discuss ways of creating software in a lighter, faster,
more people-centric way. They created the Agile Manifesto, widely regarded as the
canonical definition of agile development, and accompanying agile principles.

Some of the principles behind the Agile Manifesto[3] are:

 Customer satisfaction by rapid, continuous delivery of useful software


 Working software is delivered frequently (weeks rather than months)
 Working software is the principal measure of progress.
 Even late changes in requirements are welcomed.
 Close, daily, cooperation between business people and developers
 Face-to-face conversation is the best form of communication.
 Projects are built around motivated individuals, who should be trusted
 Continuous attention to technical excellence and good design.
 Simplicity
 Self-organizing teams
 Regular adaptation to changing circumstances
What is Ajax.NET Professional (AjaxPro) ?
- Ajax, shorthand for Asynchronous JavaScript and XML, is a web development
technique for creating interactive web applications Ajax.net is more lightweight and
elegant
- running on all web browsers that support JavaScript and XMLHttpRequest (iframe
replacement for ActiveX disabled web browsers) including Windows Mobile and
other smart phones
Do I need IIS to run Web applications in ASP2.0?
If you are using Visual Studio, you can use the ASP.NET Development Server built
into Visual Studio to test your pages. The server functions as a local Web server,
running ASP.NET Web pages in a manner virtually identical to how they run in IIS.
To deploy a Web application, you need to copy it to a computer running IIS version 5
or 6
Can two different programming languages be mixed in a single ASPX file?
ASP.NET built-in parsers are used to remove code from ASPX files and create
temporary files. Each parser understands only one language. Therefore mixing of
languages in a single ASPX file is not possible
How does System.Web.UI.Page's IsPostBack property work?
IsPostBack checks to see whether the HTTP request is accompanied by postback data
containing a __VIEWSTATE or __EVENTTARGET parameter. If there are none,
then it is not a postback.
Can the view state be encrypted?
The view state can be encrypted by setting EnableViewStateMac to true and either
modifying the "machineKey" element in Machine.config to machineKey
validation=3DES or by adding the above statement to "Web.config."
Why do some web service classes derive from System.Web.WebServices while others
do not?
Those Web Service classes which employ objects like Application, Session, Context,
Server, and User have to derive from System.Web.WebServices. If it does not use
these objects, it is not necessary to be derived from it.
1234

What are VSDISCO files?


VSDISCO files are DISCO files that enable dynamic discovery of Web Services.
ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and
subdirectories for ASMX and DISCO files and returns a dynamically generated
DISCO document. A client who requests a VSDISCO file gets back what appears to
be a static DISCO document.
Why does the control's PostedFile property always show null when using
HtmlInputFile control to upload files to a Web server?
This occurs when an enctype="multipart/form-data" attribute is missing in the "form"
tag.
Is it possible to generate the source code for an ASP.NET Web service from a
WSDL?
The Wsdl.exe tool (.NET Framework SDK) can be used to generate source code for
an ASP.NET web service with its WSDL link. Example: wsdl /server
http://api.google.com/GoogleSearch.wsdl.
Why do uploads fail while using an ASP.NET file upload control to upload large
files?
ASP.NET limits the size of file uploads for security purposes. The default size is 4
MB. This can be changed by modifying the maxRequestLength attribute of
Machine.config's "httpRuntime" element.
How do I initialize a TextBox whose TextMode is "password", with a password?
The TextBox s Text property cannot be used to assign a value to a password field.
Instead, its Value field can be used for that purpose. "asp:TextBox
Value="imbatman" TextMode="Password" ID="Password" RunAt="server" "
When during the page processing cycle is ViewState available?
The view state is available after the Init() and before the Render() methods are called
during Page load.
How to change web service reference dynamically?
Changing the URL behavior from static to dynamic. This will automatically create a
entry in the "appsettings" section in the web.config file
What is the difference between absolute and relative URLs?
Absolute/ Fully qualified URLs : includes protocol moniker(http:// , ftp://) for eg :
http://localhost/faqs/faqsasp.aspx Relative URLs: Document Relative URL -
page1.aspx , Root relative URL - /dotnetanalyst/FAQs/csharpfaqs.aspx
Why do some of the events on my page fire twice?
This is probably because you explicitly subscribed to the events in code and also
specified the "AutoEventWireUp" of Page to true (it's true by default). If so, the
Page_Load, for example, will be fired once for your event subscription and once
because the Page subscribed it for you (by looking for a specific event handler
method signature). To avoid this turn off AutoEventWireUp or remove your
subscription code.
what are types of Cache Expiration in ASP.NET?
1. Output Caching(Page Caching)
<%@ OutputCache="" Duration="60" VaryByParam="none" %>
2.Fragment Caching(Partial Caching)
<@ OutputCache="" Duration="60" VaryByParam="none"
VaryByControl="CountryDropListBox" %>
3. Data Caching

(a)Smart Caching with Dependencies


Suppose our application loads a text file containing the header (that changes daily) for
the day's news: Assuming that the news changes daily, so it is logical that whenever
the header changes, the data in the cache should be refreshed as well. So there is a
dependence on the header.txt file. To express the cache's dependency on the file, use
the System.Web.Caching.CacheDependency class.
System.Web.Caching.CacheDependency depends = new
System.Web.Caching.CacheDependency(Server.MapPath("Header.txt"));
Cache.Insert("News", ds, depends);

(b)Time-Based Caching
Another technique for caching is based on time. For example, the cache can expire on
a certain date, or it will only be available for a certain period of time. There are two
ways in which you can use time-based caching:
--Absolute Expiration. The cache is set to expire on a particular date and time.
--Sliding Expiration. The cache is set to expire after a certain period of inactivity.
For example, if you have:
'===Absolute expiration===
Cache.Insert("News", ds, null, DateTime.Now.AddMinutes(2),
Cache.NoSlidingExpiration);

The cache is set to expire exactly two minutes after the user has retrieved the data.

For sliding expiration, you can use:


'===Sliding expiration===
Cache.Insert("News", ds, null, Cache.NoAbsoluteExpiration,
TimeSpan.FromMinutes(1));

This will cause the cache to be cleared if the user does not reload the page within one
minute. If the user reloads the page within the one-minute time frame, the data in the
cache will be valid for another minute.
1234

Anda mungkin juga menyukai