Using Poweshell to kill all the process with name containing particular string

Get-Process| where{ ( $_.Name.ToUpper().Contains(“MAGIC”) ) }| foreach { $_.Kill() }

SAcha Question

Reference Site for C#

WPF localization Start

The above link is very useful for starters

Debugging Data Binding

(1)  Add a App.Config File

(2) Paste the following code in <Configuration> tags

        <source name="System.Windows.Data" switchName="mySwitch">
                <add name="myListener" />

        <add name="mySwitch" value="All" />

        <add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
             initializeData="DataBindingTrace.txt" />

(3) See the magic in bin folder.


Changing SlectionColor of ListViewItem

<Style TargetType=”ListViewItem”>
<SolidColorBrush x:Key=”{x:Static SystemColors.HighlightBrushKey}” Color=”Green”/>
<SolidColorBrush x:Key=”{x:Static SystemColors.ControlBrushKey}” Color=”LightBlue”/>

Boolean To Visibilty Converter

Code for Converter  

Public class BoolToVisibilityConverter : MarkupExtension, IValueConverter
public BoolToVisibilityConverter()
TrueValue = Visibility.Visible;
FalseValue = Visibility.Collapsed;

public Visibility TrueValue { get; set; }
public Visibility FalseValue { get; set; }

public object Convert(object value, Type targetType, objectparameter, System.Globalization.CultureInfo culture)
bool val = System.Convert.ToBoolean(value);
return val ? TrueValue : FalseValue;

public object ConvertBack(object value, Type targetType, objectparameter, System.Globalization.CultureInfo culture)
return TrueValue.Equals(value) ? true : false;

public override object ProvideValue(IServiceProvider serviceProvider)
return this;

Mark Up

<StackPanel VerticalAlignment=”Bottom”>
<local:BoolToVisibilityConverter FalseValue=”Collapsed”x:Key=”btvc” />
<CheckBox x:Name=”HideOrShowCheck”>Hide or show the text…
<TextBlock Text=”Hello World!” Visibility=”{Binding ElementName=HideOrShowCheck, Path=IsChecked,Converter={StaticResource btvc}}” />