Posts

Is it possible not to implement interface method in implementation class?

Yes, it is indeed possible to avoid implementing interface methods in the implementation class. To achieve this, you can declare the methods you don't wish to implement as abstract within the interface. By doing so, you'll need to mark the class as abstract as well. This allows you to provide the implementation of the method in a derived class of the abstract class. Let's take an example scenario using C#: interface ITest  {         void Sum();  } abstract class SumTest : ITest  {        public abstract void Sum();  } In this code, the SumTest don't have the implementation of the Sum() method. This approach can be useful when you require a method implementation but don't want to provide it immediately. By using the abstract modifier, you're indicating that derived classes should implement this method. This flexibility is particularly helpful when you want to delay the implementation until a more appropriate time. abstract class Test : SumTest  {  

What is Abstraction in C#?

The process of defining a class by providing the necessary and essential details of an object to the outside world and hiding the unnecessary things is called abstraction in C#. In C# we can hide the member of a class by using private access modifiers. Let us understand this with a car example. As we know a car is made of many things, such as the name of the car, the color of the car, gear, breaks, steering, silencer, diesel engine, the battery of the car, engine of the car, etc. Now you want to ride a car. So to ride a car you should know function of Gear,Break and Steering you no need to know engine of the car.so here in case of abstraction we can hide engine details so to do that make engine function private inside class and all require thing what we should know make it's function public.

Different type of TextBox available in MahApp.Metro

Image
   1.    <TextBox Text=" Standared textBox " Width="200" Margin="5" />    2.   <TextBox metro:TextBoxHelper.ClearTextButton="True"            Text=" TextBox With Clear Button "    Width="200" Margin="5"/>   3.   <TextBox Style="{StaticResource SearchMetroTextBox}" Width="200"                                           Margin="5"  Text=" TextBox With Search Button " />  4.     <TextBox Text=" TextBox with select all text on focus " Width="200" Margin="5"         metro:TextBoxHelper.SelectAllOnFocus="True" />  5.    <TextBox Text=" TextBox Watermark " Width="200" Margin="5"         metro:TextBoxHelper.Watermark="Type something" />

What is Prism?

Image
Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms.Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others. Prism's core functionality is a shared code base in a Portable Class Library targeting these platforms. Those things that need to be platform specific are implemented in the respective libraries for the target platform. Prism also provides great integration of these patterns with the target platform. Here is the video for creating Application using Prism in Wpf

what is ConcurrentDictionary?

ConcurrentDictionary is one of five collection classes introduced in .NET 4.0. It exists in System.Collections.Concurrent namespace.ConcurrentDictionary is thread-safe collection class to store key/value pairs. ConcurrentDictionary can be used with multiple threads concurrently. Without ConcurrentDictionary class, if we have to use Dictionary class with multiple threads, then we have to use locks to provides thread-safety which is always error-prone.ConcurrentDictionary provides you an easy option. It internally manages the locking gives you an easy interface to add/update items. ConcurrentDictionary provides different methods as compared to Dictionary class. We can use AddOrUpdate, GetOrAdd ,TryAdd, TryUpdate, TryRemove, and TryGetValue to do CRUD operations on ConcurrentDictionary.