Posts

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.

What is the difference between Finalize() and Dispose() methods?

Dispose() is called when we want to realese an unmanaged resources of an object. finalize() also called for same but it doesn't assure object is garbage collected. The dispose() method is defined inside the interface IDisposable whereas, the method finalize() is defined inside the class object. The main difference between dispose() and finalize() is that the method  dispose() has to be explicitly invoked by the user whereas, the method  finalize() is invoked by the garbage collector, just before the object is destroyed.

Difference between object,var, dynamic in C#

1. object,var,dynamic can store any type of value.object and dynamic no need to initilize at the time of declaration but var should be initilize at the time of declaration. 2. object is not type safe because compiler has little information about type. dynamic is not type safe because compiler does not have any information about type. var is type safe beacuse compiler have all information about stored value. 3. object and dynamic can be passed as method arguments and also a method can return object ,dynamic type. but var can't be pass as method arguments and also no method can return var type.