Tuesday, December 22, 2009

XBAP Restrictions

XBAP Restrictions
XBAP application have some restrictions on what .NET features they can use. Since they run in partial trust they are restricted to the same set of permission granted to any InternetZone application. However 99% of standard WPF functionality is available to an XBAP application. Therefore most WPF UI features are available.


Permitted


UI Controls
Text Input controls (including RichTextBox).
Flow documents and associated readers.
XPS documents
2D drawing
3D
Animation
Audio
Video
Pages
MessageBoxes
OpenFileDialog
Internal Drag and drop (mouse driven).
Calls to WCF services.
Calls to ASMX services.


Not Permitted


Stand-alone Windows.
Most standard dialogs.
Interop with Windows controls or ActiveX controls.
Access to OS drag-drop.
Bitmap Effects (these are deprecated in .NET 3.5 SP1).
Shader Effects

Differences between XBAP, WPF Standalone and Silverlight

Differences between XBAP, WPF Standalone and Silverlight
WPF applications are divided into two categories.
• Standalone WPF Application
• XAML browser applications (XBAPs)
There is always a confusion between WPF, XBAP and Silverlight. Developers get confused which one to go for while designing a project. Here I will explain all the 3 technologies with the differences

Standalone WPF Application

- WPF applications are installed on end user's machine.
- Appear in Start Menu and Add/Remove Programs.
- Applications can be installed via MSI or ClickOnce.
- User can be offline and use the application. There is no need for Internet connection.
- Newer versions of the application may not be automatically installed in user's machine.
- WPF standalone applications can use WCF for communication.
- Applications run in its own window as other windows applications.

XAML Browser Application(XBAP)

- These type of applications are not installed in user's machine.
- They do not appear in the in Start Menu or Add/Remove Programs.
- Applications can be automatically deployed via ClickOnce.
- Applications are hosted in the browser process.
- Can be run only in IE and Firefox.
- Newer versions are always installed automatically into the user's machine.
- User must be online to use the application.
- XBAP is Windows only. We can run the application in Windows operating system only.
- XBAPs cannot use WCF.
- The user machine should have .NET framework 3.0 components.

Silverlight

- XBAP is IE and Firefox only. But Silverlight can run in any browser and platform.
- Silverlight is used for creating rich UI web application.
- User's machine don't need .NET framework.
- Can be embedded in HTML markup and rendered in any browser using the silverlight plug in.
- XABP has 99% features of WPF. But Silverlight is just a subset of WPF.

Monday, October 26, 2009

Silverlight: ImageError error #4001 in control 'Xaml1': AG_E_NETWORK_ERROR

Sys.InvalidOperationException: ImageError error #4001 in control 'Xaml1': AG_E_NETWORK_ERROR
05-17-2009 8:05 PM
Found the problem.....Silverlight doesnt like GIF's for some reason. Im gonna try other pic formats and see if they will work. So far i have only seen JPG and PNG as the recognized image format. If thats the case then SilverLight is a space hog as both of those are, if i remember right, are vector format images and usually consume, albeit a trade off, alot of storage space when you have alot of images. Anyone know if there is a way of rendering the GIF images into the Image tag?
You see the ant....I am the ant....I take you to my queen!

Thursday, September 10, 2009

Hashtable

Creating a Hashtable :
ref:http://en.csharp-online.net/Hashtable_class
http://www.c-sharpcorner.com/UploadFile/mahesh/Hashtable11082005171748PM/Hashtable.aspx


The Hashtable class in C# represents a hashtable.

private Hashtable hshTable = new Hashtable();

Adding Items to a Hashtable :

hshTable .Add("Author1", "Mahesh Chand");
hshTable .Add("Author2", "James Brand");
hshTable .Add("Author3", "Mike Gold");

Retrieving an Item Value from Hashtable:

string name = hshTable["Author1"].ToString();

Removing Items from a Hashtable
hshTable.Remove("Author1");

Looking through all Items of a Hashtable
The following code loops through all items of a hashtable and reads the values.
// Loop through all items of a HashtableIDictionaryEnumerator en = hshTable.GetEnumerator();
while (en.MoveNext())
{
string str = en.Value.ToString();
}

Using The Default Item Property To Change Its Corresponding Key

// The default Item property can be used to change the value associated with a key.
exampleTable[ "rtf" ] = "winword.exe";
// If a key does not exist, setting the default Item property
// for that key adds a new key/value pair.
exampleTable[ "doc" ] = "winword.exe";

//ContainsKey can be used to test keys before inserting them.
if( !exampleTable.ContainsKey( "ht" ) )
{
exampleTable.Add( "ht", "hypertrm.exe" );
}

New Features of Visual Studio 2008 for .NET Professionals

  1. LINQ Support
  2. Expression Blend Support
  3. Windows Presentation Foundation
  4. VS 2008 Multi-Targeting Support
  5. AJAX support for ASP.NET
  6. JavaScript Debugging Support
  7. Nested Master Page Support
  8. LINQ Intellisense and Javascript Intellisense support for silverlight applications .
  9. Organize Imports or Usings .
  10. Visual Studio 2008 Split View .
  11. HTML JavaScript warnings, not as errors .
  12. In built Silverlight Library .
  13. Visual Studio LINQ Designer.