Silverlight Tutorial - First Silverlight Application
Get link
Facebook
X
Pinterest
Email
Other Apps
-
Learn how to write your first Silverlight application. Where to get the tools and what settings to be used during development. Let's do the following steps to get development tools,
Routed events are events which navigate up or down the visual tree acording to their RoutingStrategy. The routing strategy can be bubbling, tunneling or direct. You can hook up event handlers on the element that raises the event or also on other elements above or below it by using the attached event syntax: Button.Click="Button_Click" . Routed events normally appear as pair. The first is a tunneling event called PreviewMouseDown and the second is the bubbling called MouseDown . They don't stop routing if they reach an event handler. To stop routing then we have to set e.Handled = true; . Routed events are very similar to dependency properties (though instead of the Property suffix, by convention, we use an Event suffix… though it is not required). Also need to register a RoutedEvent in the static constructor, followed by a standard .NET event wrapper. Same as for dependency properties, DO NOT put any logic in the event wrapper itself. Routi...
In this article, I will show you how to show battery status of laptop battery like is discharging, charging, full etc. We will do this using WMI because WMI have power to answer questions about battery status .So let's start with WMI. To access account information of Battery we need to Use System.Management name space. To use this name space first of all we need to add reference to System.management by Project Menu>>Add Reference . After tis at the top of the code use: using System.Management; So that you can use of its classes . Now its simple to get information about laptop Battery through querying ManagementObjectSearcher Class . We can get all information about Laptop Battery through Win32_Battery class. So we need to query on that class to get related Management object and then we just need to get various properties related to it. Dictionary < int, string > StatusCodes; private void Form1_Load(object sender, EventAr...
IFormatProvider for Numbers in C# The following example shows how to convert float to string and vice-versa using IFormatProvider . To get IFormatProvider you need to get CultureInfo instance first. Get invariant or specific CultureInfo Invariant culture is a special type of culture which is culture-insensitive. You should use this culture when you need culture-independent results , e.g. when you format or parse values in XML file. The invariant culture is internally associated with the English language. To get invariant CultureInfo instance use static property CultureInfo.InvariantCulture . To get specific CultureInfo instance use static method CultureInfo.GetCultureInfo with the specific culture name, e.g. for the German language Code: CultureInfo.GetCultureInfo("de-DE"); Format and parse numbers using the IFormatProvider Once you have the CultureInfo instance, use property CultureInfo.NumberFormat to get an IFormatProvider for number...
Comments
Post a Comment