Silverlight Quick Tip: Dynamically Updating Class Fields/Properties

August 27, 2009

In previous post (here) I blogged about displaying values of class/control in runtime and displaying them in Visual Studio - like property window. Today I’ll show how to push them back to the class instance. In previous post I’ve stored values in “ObservableCollection<FieldsPropertiesData>” for easy databinding and connected this ListBox control. In order to get user input I’ve created TwoWay databinding in DataTemplate – here is updated data template: <Style TargetType="local:FiledPropertyData"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:FiledPropertyData"> <Grid ToolTipService.Placement="Mouse" Width="{TemplateBinding Width}"> ...

Israeli Developers Community Conference 2009 – Vote For My Sessions

August 19, 2009

The Israeli Developers Community Conference (IDCC) is all about developers learning, sharing and interacting with each other in an informal and relaxed atmosphere. It will take a place at Microsoft ILDC, 13 Shenkar st., Herzeliya, Israel Monday, 14th September 2009 08:30 - 17:30 The community will decide upon the conference’s agenda – voting is open for everyone.   I’ve submitted two cool sessions: 5 Most Wanted Features in Silverlight 3 Many tips and tricks, best practices and as...

Silverlight Quick Tip: Dynamically Displaying Class Fields/Properties

August 13, 2009

In one of my projects I had to create something like Visual Studio property window, for data set of different controls/data classes. Those controls/classes are still under development and I needed the way to display/change values of those properties dynamically without even knowing what is inside. For the simple case, let’s assume the following class which holds the data: public class SampleData { public SampleData() { BooleanProperty = false; } public string StringProperty { get; set; } public bool BooleanProperty { get; set; } public Button ButtonProperty { get;...

Silverlight Quick Tip: How to Perform a Hit Test

August 11, 2009

In some cases, especially when developing rich UI application developer need to identify which control were clicked or under mouse pointer at some point of time or just under some coordinate at the UI. For those purposes Silverlight provides “FindElementsInHostCoordinates” function in VisualTreeHelper class. The function gets the Point (coordinate on the screen) or Rect (rectangular area) and UIElement which will be checked recursively to have any visual child's in desired coordinate/area. The function returns IEnumerable<UIElement>. In most cases, especially when using custom controls the returned list will have many UIElements. They need to be filtered out....