In Silverlight 4, there is a new feature very useful for so many scenarios. This is the right mouse button characteristic that you normally use to show a context menu. But there are some things that you have to take into account.
miércoles, 26 de enero de 2011
martes, 25 de enero de 2011
Retrieve items elements within ListBox control
In this post, I will show a simple method in order to retrieve the container items elements in a ListBox control by using ItemContainerGenerator.
As you can see, in container element, you will receive the ListBoxItem (or the container that you are using). This is a very simple operation in comparison with some other that you can find by web where you may read that you need to use VisualTreeHelper or navigate among elements until find the container or some other things.
foreach (var item in this.listBox.Items)
{
var container = this.listBox.ItemContainerGenerator.ContainerFromItem(item) as ListBoxItem;
if (container != null)
{
VisualStateManager.GoToState(container, "Highlighted", true);
}
}if (container != null)
{
VisualStateManager.GoToState(container, "Highlighted", true);
}
As you can see, in container element, you will receive the ListBoxItem (or the container that you are using). This is a very simple operation in comparison with some other that you can find by web where you may read that you need to use VisualTreeHelper or navigate among elements until find the container or some other things.
miércoles, 24 de noviembre de 2010
Scroll Decoupled Behavior for Silverlight
This post introduces the creation of a behavior in order to have a decoupled scroll with separated buttons for moving to the left or right the ScrollViewer and also a separated Thumb element. At the end of this post, I have pasted all the code.
martes, 16 de noviembre de 2010
HoldPressingClick Behavior
I had to design a new behavior in order to capture the pressing click action along a time. Furthermore, when this action performs, I needed to change a property of other element. Finally, I wanted to do all this in a resource dictionary (without code behind, according with MVVM).
lunes, 8 de noviembre de 2010
Dynamic Objects
In the last few days, many people asked me about how to access to properties or methods marked as private or internal in order to do unit tests or consume libraries that they are not good defined (take care about this because if a method or property has been marked as internal maybe it is because the implementation of this method can change). Anyway, I will introduce a new interesing new feature en C#, the Dynamic Objects.
domingo, 31 de octubre de 2010
Using PRISM, WCF Ria Services and MVVM together
In this post, I will introduce the usage of prism within WCF Ria Services and the pattern of design Model-View-ViewModel in a few steps.
viernes, 29 de octubre de 2010
Splash Screen in Silverlight
In my last personal project, I had to modify the splash screen silverlight in order to show a custom loading page instead of the silverlight one:
There are a lot of information in the web in order to do this, but not many of them gathered the information to explain some features that I needed: full screen, animations, logic inside this screen. I am going to try to gather all this information in this post.
There are a lot of information in the web in order to do this, but not many of them gathered the information to explain some features that I needed: full screen, animations, logic inside this screen. I am going to try to gather all this information in this post.
Suscribirse a:
Entradas (Atom)
