Steps on how to add and retrieve an instance of your resource file:
1. Right click the file, select Properties.
2. Under Build Action, select Embedded Resource as shown below
3. Syntax in retrieving an instance:
FrameworkElement content = new FrameworkElement();
Assembly asm = Assembly.GetExecutingAssembly();
Stream sre = asm.GetManifestResourceStream("namespace here);
content = XamlReader.Load(sre) as FrameworkElement;
This blog is dedicated to my experiences in programming. Contributors are welcome, please email me at jhelyn.suan@gmail.com
Wednesday, August 26, 2009
Add ShadowEffect in C# UIElement
Syntax:
DropShadowEffect dropShadowEffect = new DropShadowEffect();
dropShadowEffect.ShadowDepth = 0;
dropShadowEffect.Direction = 10;
dropShadowEffect.BlurRadius = 15;
dropShadowEffect.Color = Colors.Gold;
fe.Effect = dropShadowEffect;
DropShadowEffect dropShadowEffect = new DropShadowEffect();
dropShadowEffect.ShadowDepth = 0;
dropShadowEffect.Direction = 10;
dropShadowEffect.BlurRadius = 15;
dropShadowEffect.Color = Colors.Gold;
fe.Effect = dropShadowEffect;
Labels:
.Net,
animation,
C#,
color,
direction,
DropShadowEffect,
language,
programming,
syntax,
UIElement
Tuesday, August 25, 2009
How to add link in HTML
Link syntax
Placing a target page of your link:
1. Blank - target page will be a blank page
syntax:
2. Self - target page will be its current browsing page
syntax:
Terms and Definition
URL(Uniform Resource Locator)
Download Sample Code Here
Placing a target page of your link:
1. Blank - target page will be a blank page
syntax:
2. Self - target page will be its current browsing page
syntax:
Terms and Definition
URL(Uniform Resource Locator)
Download Sample Code Here
Monday, August 24, 2009
XML and LINQ
How to query in C# using LINQ
XDocument xmlFile = XDocument.Load(filename);
var xt = from y in xmlFile.Descendants("Users").Elements("details")
where y.Attribute("userName").Value == x
select new TempClass
{
Name = y.Element("userdetails").Attribute("userFirstName").Value
};
Download Sample Code Here
Subscribe to:
Posts (Atom)