Category: C#

How to Navigate from One Page to Another in Windows Phone 8 using Hyperlink Button?

Below is a sample code snippet demonstrating how to navigate from a page to another in Windows Phone 8 using Hyperlink Button. How to Navigate from One Page to Another in Windows Phone 8 using Hyperlink Button? Assume that the current page in “MainPage.xaml” and the “ACCode.xaml” is the destination page. One can use the code XAML <HyperlinkButton Content=”GoToAC” NavigateUri=”/ACCode.xaml” HorizontalAlignment=”Left” Margin=”73,292,0,0″ VerticalAlignment=”Top” Height=”57″ Width=”244″…

How to perform Shallow Copy in C# ?

To perform Shallow copy in C# , you can use the this.MemberwiseClone() method. How to perform Shallow Copy in C# ? Below is a sample code snippet that contains a method ShallowCopy to make a copy of the object.

DateTime and Null value in C#

Assume that you want a variable of type DateTime and you would like to have the uninitialized value or null value , you can use the nullable DateTime type. DateTime and Null value in C# When you define a DateTime variable and dont initialize it , the default value is the DateTime.MinValue. You can simply define the type as Nullable DateTime as shown in the…

C# Compiler Error – CS8152 ‘{0}’ does not implement interface membe

In this blog post, you’ll learn more about the C# Compiler Error – CS8152 and the related message description C# Compiler Error Code CS8152 C# Compiler Description for the Code :CS8152 ‘{0}’ does not implement interface member ‘{1}’. ‘{2}’ cannot implement ‘{1}’ because it does not have matching return by reference.

C# Compiler Error – CS1954 the best overloaded method match ‘{0}’ f

In this blog post, you’ll learn more about the C# Compiler Error – CS1954 and the related message description C# Compiler Error Code CS1954 C# Compiler Description for the Code :CS1954 The best overloaded method match ‘{0}’ for the collection initializer element cannot be used. Collection initializer ‘Add’ methods cannot have ref or out parameters.

How to Get the File Version of the Assembly in .NET (C#)?

The developers can use the methods and properties available in the FileVersionInfo class to retrieve the File Version of the Assembly in .NET (C#). How to Get the File Version of the Assembly in .NET (C#)? Below is a sample code snippet demonstrating how to retrieve it.

SelectMany Example in LINQ and C#

Below is a sample source code demonstrating the usage of the SelectMany method in LINQ and C#. One of the usage of the SelectMany is to return the flat list an avoid returning the lists of lists. SelectMany Example in LINQ and C#