UWP Binding vs. X:Bind part A

Monday, December 4, 2017

WPF most thrilling was probably the Binding concept, its now kind of standard in many other client frameworks (like Angular ??) Anyway like every other good thing its came with a price, like worse performance and severe debugging. In UWP Microsoft announc X:Bind –the new Binding concept who works in parallel path to old Binding concept, and supposed to leverage the performance, the Debugging, and to simplify things. However, a lots has changed from Binding to x:Bind. In this post I will facing off those two tremendous technics by syntax, concepts, performance, debugging , features, and whatever I can provide you. Behind the hood. As...
אין תגובות

TemplateBinding and TemplateParent Digging

Monday, May 9, 2016

One of the things that can completely freak you out. Lets start with facts: 1.  While customize an application you might use something like this: <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=MyProperty}"/> Or maybe this: <TextBlock Text="{TemplateBinding MyProperty}" /> While this is on the ResourceDictionary of your app and about to styling your custom control, and MyProperty is an DependencyProperty on the logic part of the Control so what the different between those two?  And what the default choose should be? By the way while most of programmers used to write You can use the Short way as: Text="{Binding TemplatedParent.MyProperty2}" 2.    A full demonstration will be like  this one: public class CustomControl1 : Control ...
אין תגובות

Using Dictionary as Binding source for Xaml Collection

Wednesday, August 26, 2015

If you find the trigger just pull it off.. Unfortunately I have found more than once programmers who used to translate the dictionary struct into an IEnumerable to present one dimension collection at the UI, And its is not because ObseervableCollection problem since it is quite easy to have an ObservableDictionary if you have the Notification binding consideration. Assume you have an Dictionary of key value in your model, lets say of CustomerName, and a Customer, while you already have it, and all what yours App is about Customer Names in DropDown List, but in underline you do need the real Entity...
אין תגובות

ADV. Xaml Programing part 2 – binding to Methods

Thursday, July 2, 2015

Usually binding has been designed for properties, But there is exceptional cases of course, generally not because of yours architecture but because others, The point is that is possible, Let’s start with ObjectDataProvider . it is an old trick to represents data in xaml endpoint, And make the things shorter, In this case we just define a Xaml reference to the class who hold the desired function For Example : public static class HelperBinding { public static string Test() { ...

ADV. XAML programing part 1 – Tag Element for Binding tricks

Tuesday, March 17, 2015

.Really a powerful and cool feature ..You have a native control, like button, textElement, dataGrid etc Now you like to implement something like decorator pattern to use on the control. You can "Tag" your ..control Meaning, use the property Tag to extend your control and than stick on it an additional properties .from other class Meaning , every Xaml Object has a Datacontext Property, which can be used for DataBinding , we can also trying to invoke things by relative binding technics, but sometimes its not enough, so Tag .property could be a fantastic solution ,The Tag property is part of FrameworkElement class and is from type...
תגובה אחת

Custom MarkUp Extension

Thursday, November 20, 2014

..lets have some fun , customize our own markup Extension {}markup is all what inside xaml binding start with .meaning, for the xaml parser is go search for relevant function to resolve the value :To create a simple one you can do like that public class StringFormatExtension : MarkupExtension { public StringFormatExtension() { } public StringFormatExtension(int a, int b) { ...
אין תגובות

WPF Bind Collection based on ToStinrg might demolish your Binding

Tuesday, November 18, 2014

few days ago I was in a middle of WPF-MVVM workshop and I built a live demo with some Object who implement INotifyPropertyChanged interface and based on ObservableCollection to the .Listbox .this is very basic demo to show the power of the technology In this point my object Model was shows on the UI as “NameSpace.ClassName” so I just were ..decide to override the toString on it to see the Object details and all was just great ..The Problem The next level was to open the selected item in EditBox there we can try to change the item data .and see the changes on the main...
תגובה אחת

WPF string is null or empty using Xaml Trigger

Monday, October 20, 2014

:Nice to have When work on xaml and no C# available from any reason (no binding and no converter) :We can also do some tricks on UI like in this case We have a textBlok and we need to hide it when no text presented In C# we use to write if(! String.IsNullOrEmpty(string value)) :But, it can be easily done with pure Xaml with Trigger like <Style TargetType="TextBlock"> <Style.Triggers> <Trigger Property="Text" Value=""> ...
2 תגובות

Observable Dictionary – implementation

Tuesday, September 16, 2014

,This is not a full implementation but only a starter for dummies ,still it is very nice to look on it and try it by yourself lets face it, Dictionary is one of the complex collections, and to be Observable required good .knowledge in collections , and INotifyCollectionChanged Interface .To be fully implemented we need to extend few parts which I discussed later Back to business , in earlier post I have been demonstrate the needs of ObservableDictionary. LINK But even without this scenario it is simple requirement, I am also wondering why there isn’t built .it in dot net framework :So lets build a simple one What...

Observable Dictionary – Introduction

Sunday, September 14, 2014

:First describe the following scenario ,As a front-end programmer Given object called User, User class has much data include name property .Now, to be clear we are not allow to touching this class its protected from changes ,Well our goal is present in App UI a list of Users, but with different names .Meaning, do not show the original name only a nickname for each User Item :Well, few solutions could overcame here , we can template this object with DTO class like Public class DTOUser { IUSer user; String userNickNAme; } :Or to inherited User like Public class PresentedUser : User { String...