Usman ur Rehman Ahmed's blog http://blog.usmanahmed.info It starts with a glimpse or a passing thought, it ends with obsession... posterous.com Sat, 26 May 2012 01:41:00 -0700 PTCL vs. Worldcall EVDO in Peshawar http://blog.usmanahmed.info/ptcl-vs-worldcall-evdo-in-peshawar http://blog.usmanahmed.info/ptcl-vs-worldcall-evdo-in-peshawar

Normal 0 false false false EN-US X-NONE X-NONE

Just so that you know, PTCL EVDO does operate on a different frequency in Peshawar and also its signal strength is not very good in Hyatabad area at all. Just in case you are visiting Peshawar I would recommend you to visit WorldCall center for USB device. Only 256 kbps package is available but I found it amazingly good. Give it a try.

Wordcall_evdo
Ptcl_evdo
Note: Operating frequency and respect signal strength varies from region to region. I gave it a try in phase 5 Hyatabad. However make sure you have consulted someone before. Likely PTCL EVDO to perform better in some other region.

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Mon, 02 Apr 2012 19:23:00 -0700 Marketplace Test Kit: How To? http://blog.usmanahmed.info/marketplace-test-kit-how-to http://blog.usmanahmed.info/marketplace-test-kit-how-to

With Windows Phone 7.1 SDK you are equipped with a Marketplace Test Kit which allows you to test applications (XAP packages) for passing Marketplace certification requirements (iconography, XAP file size, etc), memory consumption, leakage and proper exception handling in an automated and monitored way. It also provides a list of manual tests which may further help mature you applications. Here’s how,

Step 1: Open Marketplace Test Kit Console

Step_1_-_open_marketplace_test_kit

Note:  If at the bottom you see a message that updated test cases are available please do so please do perform an update since Marketplace requirement will keep changing.

Step 2: Confirm Application package path points to Release version

Step_2_-_confirm_application_package_path_to_release

Note: As it would be obvious since you are testing a XAP file in Release mode you can also test a .xap file even if the source is not available. Just make sure that XAP package name meets the same name given to current open visual studio project (or its corresponding XAP package).

And the four tabs on the left are all that you need to perform these tasks. If not, see this great video from Microsoft User Community,

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Tue, 20 Mar 2012 16:31:00 -0700 Toggle Partial Rendering for Module Controls in DNN http://blog.usmanahmed.info/toggle-partial-rendering-for-module-controls http://blog.usmanahmed.info/toggle-partial-rendering-for-module-controls

In DNN version 6.0 by default the module controls supports partial rendering/AJAX. Depending upon your needs (force download file for example) you can toggle this functionality as following,

Step 1

Go to Host > Extensions > Edit your module by clicking on the little pencil icon.

Step 2

Edit the desired module control for which you want to enable/disable "partial rendering" 

Module_controls
Step 3

Check/Uncheck "Supports partial rendering?" and press Update.

Supports_partial_rendering

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Wed, 22 Feb 2012 03:21:00 -0800 Preview InputScope in Windows Phone 7 http://blog.usmanahmed.info/preview-inputscope-in-windows-phone-7 http://blog.usmanahmed.info/preview-inputscope-in-windows-phone-7

InputScope is a means in Windows Phone 7 applications to restrict user input to specific input scope by providing specific keyboard layout. For example, a text field designated to take input of cell phone number should differ in keyboard layout from the one that allows writing Url.

All you need to do is to instantiate a specific InputScopeName object by providing the concrete InputScopeNameValue value; add that object in InputScope Names collection which can then be assigned to the input text control. However since InputScopeNameValue enumeration allows many possible variations of keyboard inputs, here is a simple application that lists all enumeration values in a list picker control. Upon selecting a specific enumeration value it is set with relative text field to see difference in keyboard before choosing one that suits your needs.

Download Source : http://usmanahmed.info/downloads/windows-phone-input-scope-tester.rar

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Mon, 13 Feb 2012 13:52:00 -0800 How to add new reports in DNN Site Log? http://blog.usmanahmed.info/how-to-add-new-reports-in-dnn-site-log http://blog.usmanahmed.info/how-to-add-new-reports-in-dnn-site-log

This is a beginner level post and the purpose is to introduce you how SiteLog is organized and add a new report in Site Log.

First, we'll look at how Site Log works and then introduce a new report. At the core of Site Log there are two tables,

Lists (Table)

Lists table is used throughout DNN for a number of purposes. This table contains types of reports available in SiteLog type drop down. With a default DNN installation 12 reports are avaialble filtered by the field ListName as following,

Site_log_reports_drop_down

SELECT *

    FROM {databaseOwner}{objectQualifier}Lists where ListName = 'Site Log Reports'

The resultant shows that each record is assigned a unique value (identified by Value field) from 1 - 12.

Site_log_reports
SiteLog (Table) 

Thi s table contains data for site log which is used by the stored procedure to render.

GetSiteLog (Stored Procedure/s) 

GetSiteLog referres to a series of stored procedures each affixed by a number denoting which report it belongs to. For example SiteLog5 referrs to the Lists table record identified by Value field equal to 5 which is 'Page Views By Hour'.

How to add a new report in SiteLog

Step 1: To add a new report type, simply add a new record in Lists table providing it a new unique value. Please make sure that value is unqiue. Based over this unique value, the respective report stored procedure is called as we shall see.

Here I'll add a new report as existing report 'Page Views By Day' but that will list views by annonymous users only,

/* insert into the list of reports */
INSERT INTO {databaseOwner}[{objectQualifier}Lists]
           ([ListName]
           ,[Value]
           ,[Text]
           ,[ParentID]
           ,[Level]
           ,[SortOrder]
           ,[DefinitionID]
           ,[Description]
           ,[PortalId]
           ,SystemList)
     VALUES
           ('Site Log Reports'
           ,13
           ,'Anonymous Page Views By Day'
           ,0
           ,0
           ,0
           ,-1
           ,NULL
           ,-1
           ,1)
GO

So now our site log drop down will have a new report listed. However clicking on this report will report an error that GetSiteLog13 doesn't exiss so we need to create one.

Step 2: Create the stored procedure that outputs tabular data required to be rendered. Since we are only tweaking the 'Page Views By Day' data, we can simply use the existing stored proecredure GetSiteLog1 and change it a bit.

Here's how our new SP look like after changing,

/*This SP will return page views by day for annonymous users only.*/

CREATE procedure {databaseOwner}[{objectQualifier}GetSiteLog13]

@PortalID int,
@PortalAlias nvarchar(50),
@StartDate datetime,
@EndDate datetime

as

select datepart(weekday,DateTime) AS 'WeekDay',
 count(*) AS 'Views',
 count(distinct {objectQualifier}SiteLog.UserHostAddress) AS 'Visitors',
 count(distinct {objectQualifier}SiteLog.UserId) AS 'Users'
from dbo.SiteLog
where PortalId = @PortalID and UserId IS NULL
and {objectQualifier}SiteLog.DateTime between @StartDate and @EndDate
group by datepart(weekday,DateTime)
order by WeekDay

 

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Thu, 09 Feb 2012 13:30:00 -0800 Swap current and next (may not be immediate) records http://blog.usmanahmed.info/swap-current-and-next-may-not-be-immediate-re http://blog.usmanahmed.info/swap-current-and-next-may-not-be-immediate-re

The stored procedures below can usually be used to swap two records fulfilling a given criteria.Note that the swapping will work even if some records between these two have been deleted. i.e. the monotonic sequence 0, 1, 2 ... is not strictly followed. (e.g. 0, 1, 3, 6, 7...)

The sample use demonstrated here is to swap the Display Priority of two recrods from the table ProjectsPerTab. Such a situation is often required in sorting item by item or giving precedence to one item over other as shown below,

Swap_records
ProjectsPerTab Table Schema

- pk (Primary key - int)

- TabId (Foreign Key from DNN Tabs table - int)

- ProjectFK (Projects table foreign key - int)

- DisplayPriority (int)

Move Down (Increase Display Priority/Swap with next record)

create procedure {databaseOwner}{objectQualifier}IncreaseProjectDisplayPriority
    @TabId int,
    @ProjectFK int
as
    begin
        -- Step 1: Retrieve display priority of this project and store that since that will be the last one to be updated

            declare @CurrentProjectDisplayPriority int
            select @CurrentProjectDisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where TabId = @TabId and ProjectFK = @ProjectFK

        -- Step 2: Exchange display priority with next one

            declare @pk int
            declare @DisplayPriority int

            -- Select minimum primary key for this tab with display priority greater than that of current project
            select @pk = min(pk) from {objectQualifier}ProjectsPerTab where TabId = @TabId and DisplayPriority > @CurrentProjectDisplayPriority
            select @DisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where pk = @pk

            if @pk is not null
            begin
                -- Exchange display priorities
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @CurrentProjectDisplayPriority where pk = @pk
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @DisplayPriority where TabId = @TabId and ProjectFK = @ProjectFK
            end

    end

GO

Move Up (Decrease Display Priority/Swap with previous record)

create procedure {databaseOwner}{objectQualifier}DecreaseProjectDisplayPriority
    @TabId int,
    @ProjectFK int
as
    begin
        -- Step 1: Retrieve display priority of this project and store that since that will be the last one to be updated

            declare @CurrentProjectDisplayPriority int
            select @CurrentProjectDisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where TabId = @TabId and ProjectFK = @ProjectFK

        -- Step 2: Exchange display priority with previous one

            declare @pk int
            declare @DisplayPriority int

            -- Select maximum primary key for this tab with display priority less than that of current project
            select @pk = max(pk) from {objectQualifier}ProjectsPerTab where TabId = @TabId and DisplayPriority < @CurrentProjectDisplayPriority
            select @DisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where pk = @pk

            if @pk is not null
            begin

                -- Exchange display priorities
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @CurrentProjectDisplayPriority where pk = @pk
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @DisplayPriority where TabId = @TabId and ProjectFK = @ProjectFK
            end

    end

GO

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Thu, 09 Feb 2012 13:16:00 -0800 Increase/Decrease all fields following a specific criterion stored procedure http://blog.usmanahmed.info/increasedecrease-all-fields-following-a-speci http://blog.usmanahmed.info/increasedecrease-all-fields-following-a-speci

Just a use of looping rocrds rather than using a cursor.

Increase Display Priority

This stored procedure will increase display priority field of provided 'project' plus all projects associated with this TabId and having display priority equivelent or greater than provided project.

create procedure {databaseOwner}{objectQualifier}IncreaseProjectDisplayPriority
    @TabId int,
    @ProjectFK int
as
    begin
            Declare @ToUpdate bit
            set @ToUpdate = 0
        -- Step 1: Retrieve display priority of this project and store that since that will be the last one to be updated

            declare @CurrentProjectDisplayPriority int
            select @CurrentProjectDisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where TabId = @TabId and ProjectFK = @ProjectFK

        -- Step 2: Loop through all records which have a display priority greater than this project's display priority
        -- and increment by one

            declare @pk int
            declare @DisplayPriority int

            -- Select minimum primary key for this tab with display priority greater than that of current project
            select @pk = min(pk) from {objectQualifier}ProjectsPerTab where TabId = @TabId and DisplayPriority > @CurrentProjectDisplayPriority
            select @DisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where pk = @pk

            while @pk is not null
            begin
                set @ToUpdate = 1
                -- if display priority is null, set it equivelent to zero (0)
                if @DisplayPriority is null
                    begin
                        set @DisplayPriority = 0
                    end

                -- Increment display priority by one
                set @DisplayPriority = @DisplayPriority + 1

                -- Update display priority
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @DisplayPriority where pk = @pk

                -- Select next records for looping
                select @pk = min(pk) from {objectQualifier}ProjectsPerTab where pk > @pk AND TabId = @TabId
                select @DisplayPriority = DisplayPriority from {objectQualifier}tb_DNM_8_ProjectsPerTab where pk = @pk
            end

        -- Step 3: Increment display priority of this project by one (1)
        if @ToUpdate = 1
            begin
                set @CurrentProjectDisplayPriority = @CurrentProjectDisplayPriority + 1
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @CurrentProjectDisplayPriority where TabId = @TabId and ProjectFK = @ProjectFK
            end
    end

GO

Decrease Display Priority

This stored procedure will decrease display priority field of provided 'project' plus all projects associated with this TabId and having display priority equivelent or less than provided project.

create procedure {databaseOwner}{objectQualifier}DecreaseProjectDisplayPriority
    @TabId int,
    @ProjectFK int
as
    begin
            Declare @ToUpdate bit
            set @ToUpdate = 0
        -- Step 1: Retrieve display priority of this project and store that since that will be the last one to be updated

            declare @CurrentProjectDisplayPriority int
            select @CurrentProjectDisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where TabId = @TabId and ProjectFK = @ProjectFK

        -- Step 2: Loop through all records which have a display priority less than this project's display priority
        -- and decrement by one

            declare @pk int
            declare @DisplayPriority int

            -- Select maximum primary key for this tab with display priority less than that of current project
            select @pk = max(pk) from {objectQualifier}ProjectsPerTab where TabId = @TabId and DisplayPriority < @CurrentProjectDisplayPriority
            select @DisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where pk = @pk

            while @pk is not null
            begin
                set @ToUpdate = 1
                -- if display priority is null, set it equivelent to zero (0)
                if @DisplayPriority is null
                    begin
                        set @DisplayPriority = 0
                    end

                -- Increment display priority by one
                set @DisplayPriority = @DisplayPriority - 1

                -- Update display priority
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @DisplayPriority where pk = @pk

                -- Select next records for looping
                select @pk = max(pk) from {objectQualifier}ProjectsPerTab where pk < @pk AND TabId = @TabId
                select @DisplayPriority = DisplayPriority from {objectQualifier}ProjectsPerTab where pk = @pk
            end

        -- Step 3: Increment display priority of this project by one (1)
        if @ToUpdate = 1
            begin
                set @CurrentProjectDisplayPriority = @CurrentProjectDisplayPriority - 1
                update {objectQualifier}ProjectsPerTab set DisplayPriority = @CurrentProjectDisplayPriority where TabId = @TabId and ProjectFK = @ProjectFK
            end
    end

GO

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Mon, 16 Jan 2012 15:26:00 -0800 DNM Rad Footer section not displayed for view form http://blog.usmanahmed.info/dnm-rad-footer-section-not-displayed-for-view http://blog.usmanahmed.info/dnm-rad-footer-section-not-displayed-for-view

Assuming your main content lies wihtin the Body section of a view form, If you will not check the property "Multiple Rows" the footer section will be displayed as following,

Edit_button
To fix this, simply go to view form properties and check "Multiple Rows" so that body is parsed properly and footer section is displayed.

Multiple_rows

The desired peroper will now be rendered with footer section properly,

Add-button-dnm-rad

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Fri, 06 Jan 2012 13:10:00 -0800 Windows Phone 7 ResolveHostNameAsync http://blog.usmanahmed.info/windows-phone-7-resolvehostnameasync http://blog.usmanahmed.info/windows-phone-7-resolvehostnameasync

The class DeviceNetworkInformation packaged within namespace Microsoft.Phone.Net.NetworkInformation provides two overloaded methods to resolve hostname asynchronously.

The overloads differ such that former allows you to specify the network interface using which hostname needs be resolved where as earlier will use the first avialable network interface in the list (If both WiFi and Ethernet are available then my understanding is that Ethernet will take precedence)

Here is a simple app demonstrating how to retrieve IPs against hostname.

Resolve-hostname
Note: Since call to method (ResolveHostNameAsync) is asynchronous in nature, the foreground thread won’t let you interact with the UI interface in the callback method  nameResolutionCallback(NameResolutionResult result). That's why you will see that interaction with UI is managed by call to dispatcher. However a more sophisticated approach will be to execute this call on the background thread.

Code behind

        private void btnResolveHostName_Click(object sender, RoutedEventArgs e)
        {
            if(!string.IsNullOrEmpty(txtHostName.Text))
            {
                DnsEndPoint endPoint = new DnsEndPoint(txtHostName.Text, 80);
                Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation.ResolveHostNameAsync(endPoint, nameResolutionCallback, new object());
            }
        }

        public void nameResolutionCallback(NameResolutionResult result)
        {
            if (result.NetworkErrorCode == NetworkError.Success)
            {
                List<string> items = new List<string>();
                items.Add(string.Format("Network Interface Type : {0}", result.NetworkInterface.InterfaceType));

                foreach (IPEndPoint ipEndPoint in result.IPEndPoints)
                {
                    items.Add(string.Format("Resvoeld IP : {0}:{1}", ipEndPoint.Address.ToString(), ipEndPoint.Port.ToString()));
                }

                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    lstInfo.ItemsSource = items;
                    txtHostName.Focus();
                });
            }
            else
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show(result.NetworkErrorCode.ToString(), "Error", MessageBoxButton.OK);
                    txtHostName.Focus();
                });
            }
        }

XAML

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Resolve Hostname" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <TextBox Name="txtHostName" Width="300" Margin="6,-5,150,623" Text="google.com"></TextBox>
            <Button Name="btnResolveHostName" Margin="300,-5,-5,623" Click="btnResolveHostName_Click">Resolve</Button>
            <ListBox Name="lstInfo" Margin="12,79,6,39" BorderThickness="1" BorderBrush="Azure"></ListBox>
        </Grid>
        </Grid>

 

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Tue, 27 Dec 2011 14:53:00 -0800 The Holy Qur'an App http://blog.usmanahmed.info/the-holy-quran-app http://blog.usmanahmed.info/the-holy-quran-app

A multilingual Windows Phone 7 Qur'an (القرآن الكريم) app.

Version 1.0.0

- Status: launched ()

- Marketplace Url: http://www.windowsphone.com/en-US/apps/c81a7a7c-ffbd-46cb-8cb5-5503f8d88fa6

Features

- Surah Index in Arabic and English

- Search in English with results rendered in both Arabic and English

- Surah rendering in portrait view in both Arabic and English

- Enlarge/Reduce font

- Copy search results and surah contents through context menu

Screenshots

Version 1.1.0

- Status: Under development

Features

- True multilingual support

- Themeing

- Portrait + Landscape views support

- Waiting to hear from you for more :)

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Sun, 23 Oct 2011 00:11:00 -0700 Panorama Control Background Image Resolution http://blog.usmanahmed.info/panorama-control-background-image-resolution http://blog.usmanahmed.info/panorama-control-background-image-resolution

Note: As per official MSDN documentation, the standard for background image needs to be between 480 x 800 pixels or 1024 x 800 pixels (width x height),

http://msdn.microsoft.com/en-us/library/ff941107%28v=vs.92%29.aspx

Above image display during application execution and note how properly the middle panorama item displays with a total of three panorama items.

2
The same background image but with five panorama items defined on page now distorts the view on second panorama item is in foucus. Some part of the background from first page is now shared when second panorama item gets in focus.

3

This happens since the background image of panorama control maintains its aspect ratio (provided a standard size iamge is used such as 1024 x 800) irrespective of number of panorama Items defined on your phone page.   This results in a smooth scrolling experience.

Thus, if you want to avoid overlapping between panorama items, extend the image horizontally so that each panorama item gets its own space making each panorama items getting fous a new experience to the end user.

Pay Special Attention to Extra Space

Below I have presented a standard that works best for three panorama items such that each panorama item has its own canvas as shown in the grid. The white regions denote the transition boundary and is shared between pages to give a feeler that sliding is possible just as the conept of Panorama control is.

Panorama-control-three-panorama-items-grid
As highlighted in the above figure, if the red porition on the right (without number) is removed then the canvas of each page is no longer unique and will be shared between panorama items as you slide as shown below,

Distored-view-panorama-item
The image can be extended further as the number of panorama items grow.

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Wed, 12 Oct 2011 16:58:00 -0700 Downloading Windows Phone SDK 7.1 http://blog.usmanahmed.info/downloading-windows-phone-sdk-71 http://blog.usmanahmed.info/downloading-windows-phone-sdk-71

Windows Phone 7.5 (Mango) software development kit is now available as SDK 7.1 and can be downloaded from,

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570

A total of 503 MB in size with following features downloaded during this setup,

                1- Windows Phone Emulator x64

                2- Windows Phone SDK 7.1 Assemblies

                3- Microsoft Silverlight 4 SDK

                4- Windows Phone SDK 7.1 - ENU

                5- Windows Phone SDK 7.1 Add-in for Visual Studio 2010 - ENU

                6- Microsoft XNA Game Studio 4.0 Refresh

                7- Windows Phone SDK 7.1 Extensions for XNA

                8- WCF Data Services SDK for Windows Phone

                9- Microsoft Advertising SDK for Windows Phone

                10- Microsoft Expression Blend 4 for Windows


Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Wed, 12 Oct 2011 07:10:00 -0700 Windows phone 7 pass custom object between pages http://blog.usmanahmed.info/windows-phone-7-pass-custom-object-between-pa http://blog.usmanahmed.info/windows-phone-7-pass-custom-object-between-pa

There is confusion around on how to pass data/composite objects between pages on Windows Phone 7. Here is a very simple way to achieve this,

1- Introduce a public property within your App.xml.cs file to get/set the composite object required during pages navigation. Something like this ,

    public static MyObject CurrentObject {
        get;
        set;
    }

2- Store the object using App class reference from navigating page but before navigating,

    App.CurrentObject = new MyObject("Hello World");

3- Referencing App.CurrentObject on navigated page will return you the object you need.

 

Note: Just in case you don't want the public property to be static, you can acquire a reference to App class as following,

    (Application.Current as App).CurrentObject

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Sat, 24 Sep 2011 12:57:00 -0700 HTC HD2 with Windows 6.5 Internet Settings for Warid Telecom http://blog.usmanahmed.info/htc-hd2-with-windows-65-internet-settings-for http://blog.usmanahmed.info/htc-hd2-with-windows-65-internet-settings-for

To turn on Internet on my HTC HD2 (running OS Windows 6.5) I had to go to,

Start > Settings > Menu (All Settings) > Connections > Connections

                Select “Add a new modem connection” (under Mobile Internet heading on top)

Following settings worked for me,

Connection Name: Warid Internet (you can change it as per your need)

Modem: Cellular Line (GPRS)

Access Point Name (APN): warid

The only other setting you will have to make is for proxy as follows,

HTTP: 000.000.000.000

Port: 8080

You don’t need username, password, and domain or need to set advanced settings

For MMS you will have to create a new conection as following,

Access Point Name (APN): mms.warid

The only other setting you will have to make is for proxy as follows,

WAP: 010.004.002.002 (10.4.2.1)

Port: 9201

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Mon, 05 Sep 2011 06:26:00 -0700 Filter DataSet using Linq http://blog.usmanahmed.info/filter-dataset-using-linq http://blog.usmanahmed.info/filter-dataset-using-linq

At times you will come across a scenario where you need to retrieve a data set and perform filtering on client end. Here is how you would do that

    public DataSet GetSysComboTable(string comboName)
    {
        DataSet ds = null;
        //Retrieve and fill ds here

        //At this point, you have a data set prefilled and you want to return a data set filtering the records
        //based over a column name "ComboName" with value "Hello World"

        //Acquire an empty data set that will be filled with filtered values and returned
        DataSet dsRet = new DataSet();
        try
        {
            //Filter the data set now
                    var qry = from row in ds.Tables[0].AsEnumerable()
                              where row.Table.Columns.Contains("ComboName") &&
                              !row.IsNull("ComboName") && row["ComboName"].ToString().ToLower() == "hello world"
                              select row;
                if (qry != null && qry.Count() > 0)
                {
                    dsRet.Tables.Add(qry.CopyToDataTable());
                }
                return dsRet;
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
            }
            catch (Exception)
            {
                throw;
            }
    }

 

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Wed, 22 Jun 2011 08:32:00 -0700 Properties of TableLayoutPanel control for normal use http://blog.usmanahmed.info/properties-of-tablelayoutpanel-control-for-no http://blog.usmanahmed.info/properties-of-tablelayoutpanel-control-for-no

The use of TableLayoutPanel allows contained controls/panels to grow dynamically during execution while keeping the container control size same.

In most cases we require the TableLayoutControl to be placed on a form or a user control of which size is pre-defined and to achieve dynamic expansion behavior, we need to do following,

Nest Controls

Introduce Multiple rows in Table Layout Panel control

Within each row place a Windows Panel control and set

-          AutoSize = True for that panel control

also make sure that each row has AutoSize = True

 Within each Panel control, introduce as many controls as you require

 Set following properties,

Container Control Properties

-          AutoScroll = True

-          AutoSizeMode = Grow & Shrink

-          AutoSize = False

                TableLayoutPanel Properties

-          AutoSize = True

-          Set AutoSize = True for each row as well

               

 

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Fri, 10 Jun 2011 05:25:00 -0700 Visual Studio SubReports Page Margins are Ignored http://blog.usmanahmed.info/visual-studio-subreports-page-margins-are-ign http://blog.usmanahmed.info/visual-studio-subreports-page-margins-are-ign

I had three nested reports as following,

Report A contained

                Report B contained

                                Report C 

I set the Left margin of Report A as 0.5in, Report B as 0.5in and Report 3 as 2in each, however I identified that in the print preview page margins of both child level reports will be ignored and only top level report page margins is applied.

Report-properties-page-margin
Thus, if the page margins of a subreport are set, it won't make a difference in the actual output and the margin of the top most level report will be applied.

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Tue, 24 May 2011 03:09:00 -0700 Text Styles for Windows Phone 7 http://blog.usmanahmed.info/text-styles-for-windows-phone-7 http://blog.usmanahmed.info/text-styles-for-windows-phone-7

In Windows Phone 7 it is extremelly simple to achieve mutiple levels (nested text items) of display by means of a List Box. This is often a requirements and such a scenario is shown below,

Nested-list-box
The trick here is to set style of each TextBlock control uniquely and set each item style exclusively.  Following eleven styles are possible to be applied on TextBlock using {StaticResources} markup extension as part of Windows Phone 7 default Text Styles (Theme resoruces),

Various-text-block-styles
XAML Code

                    <ListBox x:Name="SearchListBox" Margin="0,112,-12,0" Height="522">

                        <TextBlock Text="Item 1" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextBlockBase}"/>

                        <TextBlock Text="Item 2" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextNormalStyle}"/>

                        <TextBlock Text="Item 3" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextTitle1Style}"/>

                        <TextBlock Text="Item 4" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextTitle2Style}"/>

                        <TextBlock Text="Item 5" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextTitle3Style}"/>

                        <TextBlock Text="Item 6" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextLargeStyle}"/>

                        <TextBlock Text="Item 7" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>

                        <TextBlock Text="Item 8" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextGroupHeaderStyle}"/>

                        <TextBlock Text="Item 9" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSmallStyle}"/>

                        <TextBlock Text="Item 10" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextContrastStyle}"/>

                        <TextBlock Text="Item11" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextAccentStyle}"/>

                    </ListBox>

Ref: http://msdn.microsoft.com/en-us/library/ff769552%28v=vs.92%29.aspx

(See Text Styles section)

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Fri, 20 May 2011 02:37:00 -0700 Read Text File contents in Windows Phone 7 Application http://blog.usmanahmed.info/read-text-file-contents-in-windows-phone-7-ap http://blog.usmanahmed.info/read-text-file-contents-in-windows-phone-7-ap

There are many threads on the web that speak of reading a text file in a Windows Phone 7 application however most of them target Isolated Storage which is required when you need to manipulate data during execution/runtime. Opposite to that there are scenarios when your application requires various forms of data avaialble as part of the application package itself and deployed on the client device rather than being manipulated during execution of your application.

This post is targeted for such a scenario and shows how to read a text file (that is packaged as part of the contents of the XAP package) in the Windows Phone 7 application. The code is as follows (assumign the file Data.txt is contained in a root folder named Data)

        public string ReadFileContents()

        {

            //this verse is loaded for the first time so fill it from the text file

            var ResrouceStream = Application.GetResourceStream(new Uri("/Data/Data.txt", UriKind.Relative));

            if (ResrouceStream != null)

            {

                Stream myFileStream = ResrouceStream.Stream;

                if (myFileStream.CanRead)

                {

                    StreamReader myStreamReader = new StreamReader(myFileStream);

 

                    //read the content here

                    return myStreamReader.ReadToEnd();

                }

            }

            return string.Empty;

        }

Build-action-content
Note that the Copy to Output Directory is set to “Do not copy” and Build Action is set to “Content”.

As it may be obvious to the readers, setting Build Action to “Content” makes the XAP package size larger since the text file contents are merged within the XAP package. The folder structure is maintained in the XAP package and can be verified by opening the XAP file in WinZip/Rar)

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed
Mon, 16 May 2011 04:09:00 -0700 RTL Rendering support for Windows Phone 7 http://blog.usmanahmed.info/r-to-l-rendering-support-for-windows-phone-7 http://blog.usmanahmed.info/r-to-l-rendering-support-for-windows-phone-7

Right to Left languages RENDERING is not natively supported in Windows Phone 7 at the time of this writing (May 15, 2011). The text (and I am talking about Arabic and Urdu here specifically) appears broken in reverse order (since RtoL support is not avaialble) as shown below,

Reversed-arabic
The mango release is coming next however as per the following thread (Ref 1), it is not known if the Arabic support will be avaialble or not,

Currently for proper rendering of Arabic (Persian and Urdu too) the only available solution is discussed by this Microsoft guy, Daniel.

http://www.danielmoth.com/Blog/RTL-Arabic-And-Hebrew-Support-For-Windows-Phon...

The solution presented by Daniel relies on a library that does the trick of reversing the Arabic string and developed by and another Microsoft fellow Bashar,

http://arabic4wp7.codeplex.com/

Thanks both!

 

Ref 1: http://answers.microsoft.com/en-us/winphone/forum/wp7-wptips/windows-phone-7-...

 

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/ZyBS9eN2hXj Usman ur Rehman Ahmed Usman ur Rehman Ahmed Usman ur Rehman Ahmed