This blog is primarily a compilation of frequently faced issues by developers with solutions which I have implemented to solve them
Tuesday, August 4, 2015
No shake on hover
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
VS2015 Extensions
Labels:
VS2015 extensions
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Thursday, July 23, 2015
Service Oriented Solutions using MSMQ and WCF
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Friday, May 15, 2015
WPF MultiBindng Converter example
Without Converter<TextBlock.Text> <MultiBinding StringFormat="{}[{0} - {1}]"> <Binding Path="Min" FallbackValue=""/> <Binding Path="Max" FallbackValue=""/> </MultiBinding> </TextBlock.Text> </TextBlock>Using Converterpublic class RangeMultiValueConvertor : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { if (values == null) return string.Empty; if (values[0] == DependencyProperty.UnsetValue || values[1] == DependencyProperty.UnsetValue) { return string.Empty; } return (string.Format("[{0} - {1}]", values[0], values[1])); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { return null; } }<local:RangeMultiValueConvertor x:Key="rangeConverter"/><TextBlock.Text> <MultiBinding Converter="{StaticResource rangeConverter}"> <Binding Path="Min"/> <Binding Path="Max"/> </MultiBinding> </TextBlock.Text>
Labels:
MultiBindng Converter example,
WPF
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Thursday, April 2, 2015
JSonConverter - Serialize and Desrialize .Net
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Wednesday, April 1, 2015
Solution for textBox text change not updating the view model/model
<TextBox Name="textBox1"
Height="23" Width="463"
HorizontalAlignment="Left"
Margin="12,12,0,0"
VerticalAlignment="Top"
Text="{Binding OriginalText, UpdateSourceTrigger=PropertyChanged}" />
TheTextBox.Textproperty has a default UpdateSourceTrigger value of LostFocus. This means if an application has a TextBox with a data-bound TextBox.Text property, the text you type into the TextBox does not update the source until the TextBox loses focus (for instance, when you click away from the TextBox).If you want the source to get updated as you are typing, set the UpdateSourceTrigger of the binding to PropertyChanged. In the following example, the Text properties of both the TextBox and the TextBlock are bound to the same source property. The UpdateSourceTrigger property of the TextBox binding is set to PropertyChanged.
Labels:
Binding,
Model,
TextBox TextChangedEvent,
ViewModel,
WPF
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Serialization Exception: PropertyChangedEventManager is not serializable
Since events are non serializable, here is the way out to deal the problem when serializing model classes which have a property changed event to notify the view model classes:
http://www.primordialcode.com/blog/post/serialization-exception-propertychangedeventmanager-serializable
[NonSerialized] private PropertyChangedEventHandler _PropertyChanged; public virtual event PropertyChangedEventHandler PropertyChanged { add { _PropertyChanged += value; } remove { _PropertyChanged -= value; } }
Labels:
Model classes,
MVVM,
Serialization,
ViewModel classes,
WPF
Solution Architect employed with Mercedes Benz with about 14 years of experience in Microsoft Technologies.
Subscribe to:
Posts (Atom)